I’m trying to use custom scripting symbols to build one version for steam and one not steam, and also the editor version to test with the player.
So I have a scripting symbol “STEAMWORK” that include steam-api code in some scripts.
There are three places where you can set this in the editor and I’m confused.
- Edit → Project Settings → Player.
- Build profiles → build profiles → Scripting symbols.
- Build profiles → build profiles → Player settings overrides.
The built-in symbol UNITY_STANDALONE_WIN add confusion because it include code even in the Unity editor. The doc says it shouldn’t :
#if UNITY_STANDALONE_WIN
Debug.Log("Standalone Windows");
#endif
In the above example, the Debug line is only included for compilation in the Windows standalone build of the project. When compiled in the Unity Editor or in other target builds, it’s omitted entirely.
So I’m really not confident for testing. My guess is :
-
Edit → Project Settings → Player.
The symbols will be used in editor and build. -
Build profiles → build profiles → Scripting symbols.
Additional symbols included in build only. Meaning leaving it empty do not remove the player settings above. -
Build profiles → build profiles → Player settings overrides.
Replace the symbols in player settings for build only. Emptying the symbols in the override actually remove player settings symbols at build time.
Let me know what you think.
EDIT:
I removed the end of the post about a third party script that was editing symbols at init time and it was a big part of my confusion. I did not understand why symbols came back despite overrides in build profiles. Now I have a better understanding :
-
Edit → Project Settings → Player.
The symbols will be used in editor and build. -
Build profiles → build profiles → Scripting symbols.
Additional symbols included in editor and build. -
Build profiles → build profiles → Player settings overrides.
Replace the symbols in player settings for editor and build.