I've recently delved into creating EditorPlugins to make it easier to edit custom resources I've created. Unfortunately, having any class that extends EditorPlugins prevents me from exporting my projects - I presume because Godot is linking against a library that does not include a symbol for the EditorPlugin class for exports. So I would like to find a way to comment out my EditorPlugin when exporting my projects but still have it there when I compile for debug so that my plugin can still be used by the editor.
The C# preprocessor seemed to be the answer to this problem and the docs even say that I can define my custom flags by adding a keyword to the Export/Features panel:
https://docs.godotengine.org/en/latest/tutorials/scripting/c_sharp/c_sharp_features.html#preprocessor-defines
Unfortunately, this is not working for me. I added the keyword 'export' to the Features panel and used #if GODOT_EXPORT
to try and use it, but the flag seems to be ignored.
#if GODOT_EXPORT
richTextLabel.BbcodeText = "release";
#else
richTextLabel.BbcodeText = "debug";
#endif
How do I set my custom flag? Is there some other way to not have this code compiled into any exported version of my project?