Пример #1
0
        /// <summary>
        /// OnGUI is called for rendering and handling GUI events.
        /// This function can be called multiple times per frame (one call per event).
        /// </summary>
        void OnGUI()
        {
            var calendarWindow = new CalendarWindow(_scheduleGenerator, _skin, 2018, 1, 1, 25f);
            var cal            = new CalendarDrawerEditor(calendarWindow);

            cal.Draw();
        }
Пример #2
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            //Draw the help box
            DrawHelpBox();

            //Display the Calendar header
            GUILayout.Label("Calendar", EditorStyles.boldLabel);

            if (GUILayout.Button("Reset To Default"))
            {
                Calendar calender = (Calendar)_calendar;
                Year  = calender.StartingYear;
                Month = calender.StartingMonth;
                _day  = calender.StartingDay;
                _calendar.ResetToDefault();
                return;
            }

            //Draw the selectors
            DrawYearSelector();
            DrawMonthSelector();

            Seperator();

            //Draw the selected date
            DrawSelectedDate();

            //Draw the calendar for the inspector.
            float buttonWidth       = 50f;
            var   calenderInspector = new CalendarInspector(_calendar, _skin, Year, Month, _day, buttonWidth);
            var   calendarDrawer    = new CalendarDrawerEditor(calenderInspector);

            calendarDrawer.Draw();

            EditorGUILayout.Space();

            DrawDefaultInspector();

            serializedObject.ApplyModifiedProperties();
        }