예제 #1
0
    public void EnableSetting(int index)
    {
        if (this.envs != null && index >= 0 && index < this.envs.Count && this.currentIndex != index)
        {
            this.currentIndex = index;
            EnverinmentSetting.EnvInfo envInfo = this.envs[index];
            RenderSettings.fog              = envInfo.fog;
            RenderSettings.fogColor         = envInfo.fogColor;
            RenderSettings.fogMode          = envInfo.fogMode;
            RenderSettings.fogDensity       = envInfo.fogDensity;
            RenderSettings.fogStartDistance = envInfo.fogStartDistance;
            RenderSettings.fogEndDistance   = envInfo.fogEndDistance;
            if (this.currentSky != null)
            {
                XSingleton <XResourceLoaderMgr> .singleton.DestroyShareResource(envInfo.skyboxPath, this.currentSky);

                this.currentSky = null;
            }
            this.currentSky = XSingleton <XResourceLoaderMgr> .singleton.GetSharedResource <Material>(envInfo.skyboxPath, ".mat", true);

            if (this.currentSky != null)
            {
                RenderSettings.skybox = this.currentSky;
            }
            RenderSettings.ambientLight = envInfo.ambientLight;
        }
    }
예제 #2
0
 public void ActiveSetting(int index)
 {
     if (this.envs != null && index >= 0 && index < this.envs.Count)
     {
         EnverinmentSetting.EnvInfo envInfo = this.envs[index];
         RenderSettings.fog              = envInfo.fog;
         RenderSettings.fogColor         = envInfo.fogColor;
         RenderSettings.fogMode          = envInfo.fogMode;
         RenderSettings.fogDensity       = envInfo.fogDensity;
         RenderSettings.fogStartDistance = envInfo.fogStartDistance;
         RenderSettings.fogEndDistance   = envInfo.fogEndDistance;
         if (envInfo.skybox != null)
         {
             RenderSettings.skybox = envInfo.skybox;
         }
         RenderSettings.ambientLight = envInfo.ambientLight;
     }
 }