Esempio n. 1
0
        public static void FlagStyleSheetChange()
        {
            // clear caches that depend on loaded style sheets
            UnityEngine.UIElements.StyleSheets.StyleSheetCache.ClearCaches();

            // for now we don't bother tracking which panel depends on which style sheet
            var iterator = UIElementsUtility.GetPanelsIterator();

            while (iterator.MoveNext())
            {
                var panel = iterator.Current.Value;

                // In-game doesn't support styling
                if (panel.contextType != ContextType.Editor)
                {
                    continue;
                }

                // Reload default style sheets to resolve variables if they changed
                UIElementsEditorUtility.ReloadDefaultEditorStyleSheets();
                panel.DirtyStyleSheets();

                var guiView = panel.ownerObject as GUIView;
                if (guiView != null)
                {
                    guiView.Repaint();
                }
            }
        }