- Home /
property.FindPropertyRelative("property") works only for attributes but not actual properties?
Hello!
I have this code in a PropertyDrawer:
property.FindPropertyRelative("propertyFloatValue").floatValue = X; // returns correct value
That does its job if the "propertyFloatValue" is this:
public float propertyFloatValue;
But I need to do some input control and assign a variable when propertyFloatValue is assigned, so I've transformed that variable in a Property:
public float propertyFloatValue { get; set; }
But for some reasons this now returns null.
property.FindPropertyRelative("propertyFloatValue").floatValue = X; // now returns null
Any help would be greatly appreciated! Thanks!
I've tried
[SerializeField] public float propertyFloatValue { get; set; }
But I get the same behaviour :(
Answer by Z_Y_X · Jul 11, 2020 at 04:46 PM
if you use getter/setter that property is not serializable. Only possible way is write your CustomEditor.
Your answer
Follow this Question
Related Questions
Efficiency of static properties 2 Answers
How do I create public read-only properties? 3 Answers
iPhoneKeyboard Set Text after validation 1 Answer
How do I expose public properties in the same way the inspector does via a gui in game? 1 Answer
Setting a property, and then making it readonly. (c#) 2 Answers