I’m about to build a “demo” version of my game, which is mostly a subset of the full game, but just including one or two scenes. There are some things I’ve like to do within the demo that I wouldn’t normally do in the full game. For example, after finishing the demo content, I’d like to jump to another scene than the game would normally go to when completing that level.
I use BuildPipeline.BuildPlayer() to create my builds. I was wondering if there was some way to set a constant, so that in my scripts I can do something like if (SomeStaticClass.IsDemoVersion) {}
, so I can do things differently in the demo than I normally would.
Currently, I see that I can add arbitrary files to my build. So, worse-case, I could add a “demo” file, or something like that, and check for its existence when running. But that seems a little messy. I was hoping there might even be an option for setting a pre-compile variable, so that I could do something like #IF UNITY_EDITOR
, only more like #IF DEMO_VERSION