Add preprocessor define symbols to Unity builder
See original GitHub issueContext
Basically, we have a few preprocessor macros that we use and it looks like there isn’t an easy way of doing that without creating a custom builder. However, I think being able to specify custom defined symbols via yaml
would be really nice!
So I was thinking something like this
defines:
- STEAM
I can implement this, if this is something you’d think would be worth having.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Scripting Define Symbols - Access in code? - Unity Forum
Download the Script or Copy/Paste it from the Below · Open Script · Go to Symbols property and add your own symbols ·...
Read more >How to Manage Scripting Define Symbols in Unity - YouTube
Unity Asset Store: http://u3d.as/DgHWhen creating a game or an app for multiple platforms you may find yourself needing an efficient ...
Read more >Custom scripting symbols - Unity - Manual
You can add and remove your own custom scripting symbols to the Scripting Define Symbols list by using the + and - buttons,...
Read more >Short Unity tip: conditional compilation with custom ...
Short Unity tip: conditional compilation with custom preprocessor directives · First, you click File/Build Settings (or CTRL+SHIFT+B, as I ...
Read more >Unity3D - Don't compile if package name doesn't exist
Preprocessors are not an invention of Unity but is a c# thing. ... package in your project add these defines to the Scripting...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I got it working, I will post the process here for anyone else that comes across this:
first, I set up my project to use a custom build script by following the steps in the documentation here: https://game.ci/docs/github/builder
relevant sections are buildMethod and customParameters
after copying the supplied template buldMethod.cs file into the
Assets/Editor/UnityBuilderAction
folder, in theGetValidatedOptions()
method, I added the following if statement:this will look for a customParameters -DEMO, and if it finds it, it will add it to the scripting defines list.
the yml code:
in the past, I used the scripting defines to create separate release and demo builds for my game. based on the description of the customParameters, I thought something like
customParameters: -DEMO
would work, but based on my testing it does not.I do not understand what the stated solution to this is. could you please describe the process in more detail? (or add it to the documentation somewhere, for future reference)