Exemple #1
0
        static SettingsProvider CreateProjectSettingsProvider()
        {
            var provider       = AssetSettingsProvider.CreateProviderFromAssetPath("Project/Graphics", "ProjectSettings/GraphicsSettings.asset");
            var graphicsEditor = Editor.CreateEditor(AssetDatabase.LoadAllAssetsAtPath("ProjectSettings/GraphicsSettings.asset")) as GraphicsSettingsInspector;

            provider.keywords = SettingsProvider.GetSearchKeywordsFromGUIContentProperties <Styles>()
                                .Concat(SettingsProvider.GetSearchKeywordsFromGUIContentProperties <TierSettingsEditor.Styles>())
                                .Concat(SettingsProvider.GetSearchKeywordsFromGUIContentProperties <BuiltinShadersEditor.Styles>())
                                .Concat(SettingsProvider.GetSearchKeywordsFromGUIContentProperties <ShaderStrippingEditor.Styles>())
                                .Concat(SettingsProvider.GetSearchKeywordsFromGUIContentProperties <ShaderPreloadEditor.Styles>())
                                .Concat(SettingsProvider.GetSearchKeywordsFromSerializedObject(graphicsEditor.serializedObject))
                                .Concat(SettingsProvider.GetSearchKeywordsFromSerializedObject(graphicsEditor.alwaysIncludedShadersEditor.serializedObject));

            provider.activateHandler = (searchContext, rootElement) =>
            {
                (provider.settingsEditor as GraphicsSettingsInspector)?.SetSectionOpenListener(provider.Repaint);
            };

            provider.icon = EditorGUIUtility.FindTexture("UnityEngine/UI/GraphicRaycaster Icon");
            return(provider);
        }
        static SettingsProvider CreateProjectSettingsProvider()
        {
            var provider = new AssetSettingsProvider("Project/Graphics", "ProjectSettings/GraphicsSettings.asset");

            provider.PopulateSearchKeywordsFromGUIContentProperties <Styles>();
            provider.PopulateSearchKeywordsFromGUIContentProperties <TierSettingsEditor.Styles>();
            provider.PopulateSearchKeywordsFromGUIContentProperties <BuiltinShadersEditor.Styles>();
            provider.PopulateSearchKeywordsFromGUIContentProperties <ShaderStrippingEditor.Styles>();
            provider.PopulateSearchKeywordsFromGUIContentProperties <ShaderPreloadEditor.Styles>();

            var graphicSettings = provider.CreateEditor() as GraphicsSettingsInspector;

            SettingsProvider.GetSearchKeywordsFromSerializedObject(graphicSettings.serializedObject, provider.keywords);
            SettingsProvider.GetSearchKeywordsFromSerializedObject(graphicSettings.alwaysIncludedShadersEditor.serializedObject, provider.keywords);

            provider.onEditorCreated = editor =>
            {
                (editor as GraphicsSettingsInspector).SetSectionOpenListener(provider.settingsWindow.Repaint);
            };

            provider.icon = EditorGUIUtility.FindTexture("UnityEngine/UI/GraphicRaycaster Icon");
            return(provider);
        }
 internal static SettingsProvider CreateProjectSettingsProvider()
 {
     var provider = new AssetSettingsProvider("Project/Cluster Input", "ProjectSettings/ClusterInputManager.asset");
     SettingsProvider.GetSearchKeywordsFromSerializedObject(provider.CreateEditor().serializedObject, provider.keywords);
     return provider;
 }