I have an enum defined as
public enum MyEnums: uint
{
ID1 = 811410733U,
ID2 = 339470096U
};
In writing a custom editor for this enum (wanting to use Odin's enum picker which is way more user friendly), I'm having trouble assigning the value back to the enum when the choice is made. I get the MyEnum value back from the picker, and then compare to what I have. If different I try to assign:
else if (enumVar != currentEnum)
{
action.MyEnum = enumVar;
isChanged = true;
}
I've tried many different things for the action.MyEnum assignment. I've tried .Value, .SafeAssign(). No matter what I try, _sometimes_ the code creates exception. I think it's because the enum is backed as uint instead of int. The exception is "value was either too large or too small for an Int32". I've tried all kinds of casting, but I can't seem to figure out how to make this work correctly. Any help would be appreciated.