Is it possible to create a custom enum?

alex oatridge 4 years ago updated by Skypatcher 4 years ago 4

I know I can create ones in C# and have it show up in the inspector but can I create a new one with the available tools?

Bolt Version:
Unity Version:
Scripting Backend:
.NET Version (API Compatibility Level):

Hi Alex! Welcome to the community :)

Unfortunately that's not possible at the moment, because it's not possible to create an enum type without compiling to script. I'll keep it in mind for the future, but for now, creating the enum through a simple script is the easiest way.

Hi, This question is marked 'Answered'.  I have a follow-up question (I can start a new thread if it is more appropriate).

Anyway, here is the question. I know how to create enum in C# script. How do I make Bolt to read my script so I can use it to create new units with custom enum? In general, how do I make Bolt include my C# scripts? Do they have to be in certain folder?

I am using Bolt 1.2. I can't get Bolt's Unit Option Wizard to browse my own scripts. Am i missing something here?

You create your enum in a new C# script. Then go up to Tools > Update Unit Options (Add the C# Script stuff to the Units database)

Then do Tools > Ludiq > Generate Custom Inspectors (This ensures the Fuzzy Finder has updated its tree, and any new types can be shown in the inspector properly). 

That is it. Scripts can be pretty much anywhere.

Thanks! It works.