Пример #1
0
        //------------------Helpers----------------------------

        public static Settings getInstance()
        {
            Settings instance = (Settings)UnityHelper.FindEditorWindow(typeof(Settings));

            if (instance == null)
            {
                instance = ScriptableObject.CreateInstance <Settings>();
            }
            return(instance);
        }
Пример #2
0
        static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
        {
            importedShaderPaths.Clear();

            foreach (string str in importedAssets)
            {
                if (scriptImportedAssetPaths.Contains(str))
                {
                    scriptImportedAssetPaths.Remove(str);
                    continue;
                }
                //if (allShaderPaths.Contains(str)) continue;
                //else allShaderPaths.Add(str);
                Object asset = AssetDatabase.LoadAssetAtPath <Object>(str);
                if (asset != null && asset.GetType() == typeof(Shader))
                {
                    Shader shader = AssetDatabase.LoadAssetAtPath <Shader>(str);
                    importedShaderPaths.Add(str);
                    deleteQueueShaders(shader, str);
                }
                else if (asset != null && str.ToLower().Contains("ThryEditor"))
                {
                    ThryEditor.reload();
                }
            }
            if (importedShaderPaths.Count == 0)
            {
                return;
            }

            if (ignore)
            {
                return;
            }
            if (!Config.Get().showImportPopup)
            {
                return;
            }
            EditorWindow window = UnityHelper.FindEditorWindow(typeof(ShaderImportFixerGui));

            if (window == null)
            {
                window = EditorWindow.CreateInstance <ShaderImportFixerGui>();
            }
            window.Show();
        }