protected override void VraiableField(Rect position, GUIContent label, IVariableSO variableSO) { var enumStringVal = variableSO.ToString(); var originalValue = (T)Enum.Parse(typeof(T), enumStringVal); var newValue = EditorGUI.EnumPopup(position, label, originalValue);; variableSO.SetValue(Enum.GetName(typeof(T), newValue)); }
protected virtual void VraiableField(Rect Position, GUIContent label, IVariableSO variableSO) { if (variableSO.ToString("ID") == "ID" || variableSO.ToString("ID") == "-ID") //check if formating made issue with data { float ParsedNum; if (float.TryParse(variableSO.ToString(), out ParsedNum)) { variableSO.SetValue(EditorGUI.FloatField(Position, label, ParsedNum).ToString()); } else { variableSO.SetValue(EditorGUI.TextField(Position, label, variableSO.ToString())); } } else { variableSO.SetValue(EditorGUI.TextField(Position, label, variableSO.ToString("ID"))); } }