Пример #1
0
        // Creates a new style catalog from a set of USS assets.
        internal static StyleCatalog LoadCatalog(string[] ussPaths, bool useResolver = true)
        {
            var catalog = new StyleCatalog();

            foreach (var path in ussPaths)
            {
                catalog.AddPath(path);
            }
            catalog.Refresh();
            return(catalog);
        }
Пример #2
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;
        }
Пример #3
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();
        }