public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { var ticksProp = property.FindPropertyRelative("ticks"); label = BeginProperty(position, label, property); BeginChangeCheck(); var newTicks = GUIControls.TimeSpanField(position, label, ticksProp.longValue, attribute is TimeOfDayAttribute); if (EndChangeCheck()) { ticksProp.longValue = newTicks; } EndProperty(); }
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { var dayProp = property.FindPropertyRelative("dayNumber"); var date = UnityDateOnly.FromDayNumber(dayProp.intValue); label = BeginProperty(position, label, property); BeginChangeCheck(); var newDate = GUIControls.DateOnlyField(position, label, date); if (EndChangeCheck()) { dayProp.intValue = newDate.DayNumber; } EndProperty(); }
public override float GetPropertyHeight(SerializedProperty property, GUIContent label) { return(GUIControls.GetHeightForFields(GUIControls.ShouldDrawWideMode(label) ? 1 : 2)); }