コード例 #1
0
        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();
        }
コード例 #2
0
        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();
        }
コード例 #3
0
 public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
 {
     return(GUIControls.GetHeightForFields(GUIControls.ShouldDrawWideMode(label) ? 1 : 2));
 }