Scripting Define Symbols - How do the work?

How do scripting define symbols work under the hood and has this changed with Unity 2020 w.r.t. Unity 2019? My understanding is that if you defined a symbol under Player > Other Settings > Scripting Define Symbols all projects would be regenerated to define this symbol and if you looked at the code in editor, the code would be in scope inside the #if MY_SYMBOL … #endif? That’s how it worked with Unity 2019, but I’m not seeing this behaviour with the 2020 LTS version.

Also, is there any interplay between the global scripting defines (under player settings) and the Version Defines set up in asmef files?

(Sorry can’t seem to edit the thread title!)

This is useful: Unity - Manual: Assembly definitions but I’m still unsure why the symbols defined under player aren’t having an effect.

As long as Unity is respecting them (and I have never seen otherwise in ten years of using Unity), then you’re golden.

If Visual Studio is tripping over its own shoelaces, here’s how you might be able to fix that:

This may help you with intellisense and possibly other Visual Studio integration problems:

Sometimes the fix is as simple as doing Assets → Open C# Project from Unity. Other times it requires more.

Other times it requires you also nuke the userprefs and .vsconfig and other crufty low-value high-hassle files that Visual Studio tends to slowly damage over time, then try the above trick.

Barring all that, move on to other ideas:

https://discussions.unity.com/t/778503

Also, try update the VSCode package inside of Unity: Window → Package Manager → Search for Visual Studio Code Editor → Press the Update button

Also, this: https://discussions.unity.com/t/805330/7

I’m using them with Unity 2021, if you open the Assembly-CSharp.csproj file in a text editor you will see all the defines and then you can make sure that your own defines are there: