Ejemplo n.º 1
0
 private void SetupSingleton()
 {
     if (Sunshine.Instance == null)
     {
         Sunshine.Instance = this;
     }
     else if (Sunshine.Instance != this && Application.isPlaying)
     {
         Sunshine.LogMessage("Multiple Sunshine Instances detected!", true);
         UnityEngine.Object.Destroy(base.gameObject);
     }
 }
Ejemplo n.º 2
0
 public bool Setup()
 {
     this.SetupSingleton();
     if (Application.isPlaying)
     {
         this.Supported = (this.Supported && SystemInfo.supportsRenderTextures);
     }
     else
     {
         this.Supported = SystemInfo.supportsRenderTextures;
     }
     if (!this.Supported)
     {
         this.DestroyLightmap();
         this.DisableShadows();
         return(false);
     }
     this.SetupLightmap();
     if (this.Ready)
     {
         return(true);
     }
     if (!this.Lightmap)
     {
         this.Supported = false;
         Sunshine.LogMessage("Unable to create Lightmap", false);
     }
     if (!this.SunLight && Application.isPlaying)
     {
         this.SunLight = this.FindAppropriateSunLight();
     }
     if (!this.SunLight)
     {
         Sunshine.LogMessage("Sun Light was not configured, and couldn't find appropriate Direction Light...", false);
         if (Application.isPlaying)
         {
             base.enabled = false;
         }
         return(false);
     }
     if (!this.OccluderShader)
     {
         Sunshine.LogMessage("Occluder Shader Missing...", false);
         if (Application.isPlaying)
         {
             base.enabled = false;
         }
         return(false);
     }
     if (!this.OccluderShader.isSupported)
     {
         Sunshine.LogMessage("Occluder Shader Not Supported...", false);
         if (Application.isPlaying)
         {
             base.enabled = false;
         }
         return(false);
     }
     if (!this.PostScatterShader)
     {
         Sunshine.LogMessage("Post Process Scatter Shader Missing...", false);
         if (Application.isPlaying)
         {
             base.enabled = false;
         }
         return(false);
     }
     if (!this.PostBlurShader)
     {
         Sunshine.LogMessage("Post Process Blur Shader Missing...", false);
         if (Application.isPlaying)
         {
             base.enabled = false;
         }
         return(false);
     }
     if (!this.PostDebugShader)
     {
         Sunshine.LogMessage("Post Process Debug Shader Missing...", false);
         if (Application.isPlaying)
         {
             base.enabled = false;
         }
         return(false);
     }
     if (!this.BlankOvercastTexture)
     {
         Sunshine.LogMessage("Blank Overcast Texture Missing...", false);
         if (Application.isPlaying)
         {
             base.enabled = false;
         }
         return(false);
     }
     this.RecreateMaterials();
     this.RecreateRenderCameras();
     this.RecreateTextures();
     this.Ready = true;
     return(true);
 }