Enums in Script Context

I’m having a bit of trouble trying to use an enum in a ScriptContext. What is the recommended way to implement or use an enum in a script:

#if SomeObject.EnumField != MyEnum.TheValue

This actually fails at run time:

 var context = new ScriptContext() {
               ScriptTypes = 
               {
                   typeof(MyEnum)
               }

            }.Init();

You can use the isEnum() or hasFlag() scripts, see:

1 Like