Ejemplo n.º 1
0
 //Store values in the volatile SessionState
 static void Init()
 {
     Installer.CheckRootFolder();
     PackageVersionCheck.CheckForUpdate();
     PostProcessingInstallation.CheckInstallation();
     PostProcessingInstallation.FindInstallationDir();
 }
Ejemplo n.º 2
0
        public static void Initialize()
        {
            IS_INSTALLED = false;
            Log.Clear();

            PackageVersionCheck.CheckForUpdate();
            UnityVersionCheck.CheckCompatibility();
            PostProcessingInstallation.CheckInstallation();
            //PPS Installation is checked before the folder is, so the installation type has been determined
            CheckRootFolder();

            Demo.FindPackages();
        }
Ejemplo n.º 3
0
            public static void Initialize()
            {
                if (EditorApplication.isPlaying)
                {
                    return;
                }

                //Package has been imported, but window may not show due to console errors
                //Force window to open after compilation is complete
                if (HAS_APPEARED == false)
                {
                    InstallerWindow.ShowWindow();
                    HAS_APPEARED = true;
                }

                //For 2018.1+, after compiling the PostProcessing package, check for installaton again
                if (PostProcessingInstallation.IS_INSTALLED == false)
                {
                    PostProcessingInstallation.CheckInstallation();
                }
            }
Ejemplo n.º 4
0
        public static void ConfigureShaderPaths(PostProcessingInstallation.Configuration configuration = PostProcessingInstallation.Configuration.Auto)
        {
            string packageDir = SCPE.GetRootFolder() + "/Effects";

            //Find all shaders in the package folder
            string[] GUIDs = AssetDatabase.FindAssets("*Shader t:Shader", new string[] { packageDir });


#if SCPE_DEV
            Debug.Log("<b>ConfigureShaderPaths</b> found " + GUIDs.Length + " shaders to reconfigure");
#endif

            configuration = (configuration == PostProcessingInstallation.Configuration.Auto) ? PostProcessingInstallation.CheckInstallation() : configuration;

            for (int i = 0; i < GUIDs.Length; i++)
            {
                string assetPath = AssetDatabase.GUIDToAssetPath(GUIDs[i]);

                Shader shaderFile = (Shader)AssetDatabase.LoadAssetAtPath(assetPath, typeof(Shader));
                string shaderName = shaderFile.name.Replace("Hidden/SC Post Effects/", string.Empty);

                EditorUtility.DisplayProgressBar("Configuring shaders for " + configuration + " installation...", shaderName + " (" + i + "/" + GUIDs.Length + ")", (float)i / GUIDs.Length);

                string fileContents = File.ReadAllText(assetPath);

                if (configuration == PostProcessingInstallation.Configuration.GitHub)
                {
                    fileContents = fileContents.Replace("PostProcessing", "../../../..");
                }
                else if (configuration == PostProcessingInstallation.Configuration.PackageManager)
                {
                    fileContents = fileContents.Replace("../../../..", "PostProcessing");
                }

                File.WriteAllText(assetPath, fileContents);

                AssetDatabase.ImportAsset(assetPath);
            }

            EditorUtility.ClearProgressBar();

            Installer.Log.Write("Modified shaders for " + configuration + " configuration...");
        }