Example #1
0
        private void RenderSkinOption()
        {
            GUILayout.BeginHorizontal(GUILayout.ExpandHeight(false));

            // label
            EditorGUILayout.BeginVertical(GUILayout.Height(39));
            GUILayout.FlexibleSpace();

            GUILayout.Label("Skin:", StyleCache.Instance.Label);

            GUILayout.FlexibleSpace();
            EditorGUILayout.EndVertical();

            // tabs
            if (_skinTabBarRenderer.Tabs.Count == 0)
            {
                // tab style
                _skinTabBarRenderer.TabStyle = StyleCache.Instance.Toggle;                 // GreenToggle;

                // tabs
                _skinTabBarRenderer.Tabs.Add(
                    new TabDescriptor(
                        new GUIContent("Light", TextureCache.Instance.LightBulbOn),
                        new GUIContent("Light", TextureCache.Instance.LightBulbOn)
                        )
                    );
                _skinTabBarRenderer.Tabs.Add(
                    new TabDescriptor(
                        new GUIContent("Dark", TextureCache.Instance.LightBulbOff),
                        new GUIContent("Dark", TextureCache.Instance.LightBulbOff)
                        )
                    );
            }

            _skinTabBarRenderer.TabIndex = EditorSettings.UseDarkSkin ? 1 : 0;

            _skinTabBarRenderer.Render();

            if (_skinTabBarRenderer.Changed)
            {
                EditorSettings.UseDarkSkin = _skinTabBarRenderer.TabIndex == 1;
                StyleCache.Reset();
                TextureCache.Reset();
                TabBarRenderer.ResetStyles();
                UpdateTabStyles();
                EditorState.Instance.ThemeChanged();
            }

            GUILayout.EndHorizontal();

            //GUILayout.Space(4);
        }
Example #2
0
 public static void Reset()
 {
     _instance = null;
 }
Example #3
0
 public static void Reset()
 {
     _instance = null;
 }