How can I bind a float SerializedProperty to an EnumField ?

There was a need that I describe int, float or enum data with a float field which depends.
And I noticed there is an INotifyValueChanged interface that helps my float field to be bound to an IntField.
So is there any possible way in which I can implement the interface of EnumField without changing source code in package? Orelse I only have to create my own custom element?
(By the way it’s source code is hard to locate since in 2021.3.0f1 package UIElement has seemed to be merged.)

Sorry but could you describe your problem a little differently? Are you saying that you have a float field, we’ll call it “BobsFloat”, and it has a corresponding enum that describes it, we’ll call it “BobsEnum” and you need to bind to BobsFloat and BobsEnum to know when either value changes? Also where does IntField come into this?

Sorry for my ambiguous discription. I have a property of type float in my ScriptableObject, and there is a need to bind it to an EnumField in UIElements. So I check out the INotifyValueChanged interface presuming it would help, since this helps a property of type int to be bound to a DoubleField.

I probably won’t be of much help but I would imagine you can bind an int to a double without a problem because int’s can be easily converted to doubles. But to bind a float to an enum, maybe that would work if the float was actually an integer like 1.0, 2.0, etc then you could get the enum using an int. But I haven’t actually done any binding yet.

1 Like

Its value is not an issue in this situation LOL. What bothers me the most is when i bind the SerializedProperty of float type to an EnumField, it just throws Error about the inappropriate type.
So I quit using EnumField.Bind(SerializedProperty), instead I register its ChangeEvent to bind my property manually.
You have my thanks anyway.