예제 #1
0
        static EditorResources()
        {
            s_StyleCatalog = new StyleCatalog();
            // Initially only load catalog with bundle resources (since they area already compiled and valid)
            s_StyleCatalog.AddPaths(UIElementsEditorUtility.s_DefaultCommonStyleSheetPath,
                                    EditorGUIUtility.isProSkin
                ? UIElementsEditorUtility.s_DefaultCommonDarkStyleSheetPath
                : UIElementsEditorUtility.s_DefaultCommonLightStyleSheetPath);
            s_StyleCatalog.Refresh();

            EditorApplication.update -= DelayInitialization;
            EditorApplication.update += DelayInitialization;
        }
예제 #2
0
        private static void BuildCatalog()
        {
            s_StyleCatalog = new StyleCatalog();
            var paths = new List <string>();

            paths.Add(UIElementsEditorUtility.s_DefaultCommonStyleSheetPath);
            paths.Add(EditorGUIUtility.isProSkin
                ? UIElementsEditorUtility.s_DefaultCommonDarkStyleSheetPath
                : UIElementsEditorUtility.s_DefaultCommonLightStyleSheetPath);
            foreach (var editorUssPath in AssetDatabase.GetAllAssetPaths().Where(IsEditorStyleSheet))
            {
                paths.Add(editorUssPath);
            }

            s_StyleCatalog.AddPaths(paths);
            s_StyleCatalog.Refresh();
        }