Fritsl
August 14, 2020, 9:52am
1
Am learning how to do Editor Window w UI Toolkit
UI Toolkit: Inserted Enum
C#: Q’ed Enum, initiated like this:
enum UIstates { listIsEmpty, browseList, editItem, addNEwItem }
debugUIstate = root.Query<EnumField>("debugUIstate");
debugUIstate.Init(UIstates.browseList);
Now Enum shows up in Editor window, with Init state, good!
Question:
How would I get the Enum Value OUT in C#?
Thanks
var val = debugUIstate.value;
should do the trick. Might need a cast.
We have a built-in sample for EnumField under Windows > UI Toolkit > Samples for more details.
Fritsl
August 17, 2020, 10:19am
3
uDamian:
var val = debugUIstate.value;
should do the trick. Might need a cast.
We have a built-in sample for EnumField under Windows > UI Toolkit > Samples for more details.
Thanks - there was that problem of the Windows > UI Toolkit > Samples did not appear to show anything other than a list of functions → window had to be resized