/// <summary> /// ShowPrefeences is method to draw Object fields, collection name, and button "Create new collection". /// </summary> partial void ShowPrefeences() { EventsConfigObject = (EventsCollection)EditorGUILayout.ObjectField(EventsConfigObject, typeof(EventsCollection), true); CollectionName = EditorGUILayout.TextField(CollectionName); if (GUILayout.Button("Create new collection")) { EventsConfigObject = (EventsCollection)ScriptableObjectUtility.CreateAsset <EventsCollection>(CollectionName); } }
private void Update() { if (EventsConfigObject != null) { _editor = Editor.CreateEditor(EventsConfigObject); _events = (EventsCollection)_editor.target; DateTime iDay = DateTime.Now; Days = new string[DateTime.DaysInMonth(Year, (int)Month)]; for (int i = 0; i < DateTime.DaysInMonth(Year, (int)Month); i++) { iDay = new DateTime(Year, (int)Month, i + 1); Days[i] = iDay.ToString("dd"); } } }