There may be a better way to go about this and feel free to make alternate suggestions but I have a need to define enumerators or constants in an editor window and make them usable in my scripts.
So I would have an editor window like so:
Name: Element
Values:
“Fire” 1
“Ice” 2
Make changes in the editor window.
Compile or rebuilt some structure necessary to make this work.
And in my code I could type the following…
if (myObject.currentElement == Element.Fire)
doStuff;
Using C# language constructs such as ExpressionTrees is it possible to do this?
Why do I want to do this?
Well, I would like to use prefabs to define lists instead of big classes with lots of static definitions that take up memory and are annoying to manage or parsing XML files that need to be encrypted so players do not go about wrecking the game logic because they can open a file and make enemies weak to fire, etc.
Thanks.