Beispiel #1
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();
            newAsset = manager.ThemeAsset;
            newAsset = (ThemeAsset)EditorGUILayout.ObjectField(newAsset, typeof(ThemeAsset), false);
            if (newAsset != manager.ThemeAsset)
            {
                manager.ThemeAsset = newAsset;
                FetchThemes();
                GUI.changed = true;
            }
            if (themes != null && themes.Length > 0)
            {
                selectedInitialTheme = EditorGUILayout.Popup("Initial Theme", selectedInitialTheme, themes);
                if (selectedInitialTheme >= 0)
                {
                    manager.InitialTheme = themes[selectedInitialTheme];
                }
            }

            serializedObject.ApplyModifiedProperties();
            if (GUI.changed)
            {
                EditorUtility.SetDirty(target);
            }
        }
Beispiel #2
0
 private void OnEnable()
 {
     asset = (ThemeAsset)target;
     if (asset.Themes == null)
     {
         asset.Themes = new Theme[0];
     }
 }