Ejemplo n.º 1
0
        public Profile Snapshot()
        {
            var profile = SavePostProcessingProfile();

            //if (Camera.main.actualRenderingPath == RenderingPath.DeferredShading)
            //{
            profile.deferred             = true;
            profile.SkinSettings         = deferredShading.SSSSS.SkinSettings;
            profile.TransmissionSettings = deferredShading.SSSSS.TransmissionSettings;
            DeferredShadingUtils.GetTessellation(out profile.phong, out profile.edgeLength);
            //}
            if (selectedCubemap == 0)
            {
                ProceduralSkybox.SaveSkyboxParams();
                profile.selectedCubemap = CubemapFileNames[selectedCubemap];
            }
            else if (selectedCubemap > 0)
            {
                Skybox.SaveSkyboxParams();
                profile.selectedCubemap = CubemapFileNames[selectedCubemap];
            }
            profile.ProceduralSkyboxParams = ProceduralSkybox.skyboxParams;
            profile.SkyboxParams           = Skybox.skyboxParams;
            if (selectedScene >= 0)
            {
                profile.selectedScene        = SceneFileNames[selectedScene];
                profile.selectedSceneVariant = SceneVariant;
            }
            return(profile);
        }
Ejemplo n.º 2
0
 public void OnLevelWasLoaded(int level)
 {
     Console.WriteLine("Scene loaded: " + SceneManager.GetActiveScene().name);
     if (!DeferredShadingUtils.IsInstance())
     {
         new GameObject("DeferredShading").AddComponent <DeferredShadingUtils>();
     }
     if (!GameObject.Find("PHIBL") && (
             SceneManager.GetActiveScene().name == "SelectScene" ||
             SceneManager.GetActiveScene().name == "EditScene" ||
             SceneManager.GetActiveScene().name == "H" ||
             SceneManager.GetActiveScene().name == "ADVScene" ||
             SceneManager.GetActiveScene().name == "Studio"))
     {
         var PHIBL = new GameObject("PHIBL");
         PHIBL.AddComponent <PHIBL>();
         PHIBL.AddComponent <ScreenShot>();
         if (SceneManager.GetActiveScene().name == "EditScene")
         {
             PHIBL.AddComponent <CamCtrl>();
         }
         else if (SceneManager.GetActiveScene().name == "Studio")
         {
             PHIBL.AddComponent <CamCtrlStudio>();
         }
         else
         {
             PHIBL.AddComponent <CheckLastMapAndTime>();
             PHIBL.AddComponent <CamCtrl>();
         }
         foreach (IPlugin plugin in PluginManager.Plugins)
         {
             if (plugin.Name == "Dynamic High Heel System (DHH)")
             {
                 PHIBL.AddComponent <DHHCompatible>();
                 break;
             }
         }
         if (!GameObject.Find("FixHDR"))
         {
             new GameObject("FixHDR").AddComponent <fixHDR>();
         }
     }
 }
Ejemplo n.º 3
0
        public IEnumerator RestoreStat(Profile profile)
        {
            yield return(new WaitForSeconds(1f));

            var scene = Singleton <Studio.Scene> .Instance;

            while (scene.isNowLoading)
            {
                yield return(new WaitForEndOfFrame());
            }

            if (profile.selectedScene != null && profile.selectedScene.Length != 0)
            {
                if (SceneFileNames.Contains(profile.selectedScene))
                {
                    var newselection = Array.FindIndex(SceneFileNames, x => x == profile.selectedScene);
                    if (selectedScene != newselection)
                    {
                        StartCoroutine(LoadScene(SceneFolder.lstFile[newselection], selectedScene != -1, profile.selectedSceneVariant));
                        selectedScene = newselection;
                        SceneVariant  = profile.selectedSceneVariant;
                    }
                    else if (profile.selectedSceneVariant != SceneVariant)
                    {
                        StartCoroutine(LoadSceneVariant(profile.selectedSceneVariant));
                        SceneVariant = profile.selectedSceneVariant;
                    }
                }
            }
            if (profile.selectedCubemap != null && profile.selectedCubemap.Length != 0)
            {
                if (CubemapFileNames.Contains(profile.selectedCubemap))
                {
                    var newcubemap = Array.FindIndex(CubemapFileNames, x => x == profile.selectedCubemap);
                    //if (selectedCubemap != newcubemap)
                    //{
                    ProceduralSkybox.skyboxParams = profile.ProceduralSkyboxParams;
                    Skybox.skyboxParams           = profile.SkyboxParams;

                    if (newcubemap == 0)
                    {
                        ProceduralSkybox.ApplySkybox();
                        ProceduralSkybox.ApplySkyboxParams();
                        EnvironmentUpdateFlag = true;
                    }
                    else
                    {
                        StartCoroutine(Loadcubemap(CubemapFolder.lstFile[newcubemap]));
                    }
                    if (StudioMode)
                    {
                        var bg = FindObjectOfType <Studio.BackgroundCtrl>();
                        bg.isVisible           = false;
                        bg.enabled             = false;
                        Camera.main.clearFlags = CameraClearFlags.Skybox;
                    }
                    selectedCubemap = newcubemap;
                    //}
                }
            }
            LoadPostProcessingProfile(profile);
            //if (profile.deferred && Camera.main.actualRenderingPath == RenderingPath.DeferredShading)
            //{
            deferredShading.SSSSS.TransmissionSettings = profile.TransmissionSettings;
            deferredShading.SSSSS.SkinSettings         = profile.SkinSettings;
            deferredShading.SSSSS.Reset();
            DeferredShadingUtils.SetTessellation(profile.phong, profile.edgeLength);
            //}
        }