Beispiel #1
0
 /**
  * Singleton instance getter for road render
  */
 public static RoadRender Get()
 {
     if (roadRender == null)
     {
         roadRender = (new GameObject("RoadRender")).AddComponent <RoadRender>();
     }
     return(roadRender);
 }
        /**
         * Change SkyBox
         */
        public void SetSkyBox()
        {
            if (Input.GetKeyUp(KeyCode.E) && !EasterEggActivated)
            {
                RoadRender.Get().ChangeRoadColors(false);
                var directionalLight = GameObject.Find("Directional Light").GetComponent(typeof(Light)) as Light;
                RenderSettings.skybox      = Resources.Load("Textures/Skybox", typeof(Material)) as Material;
                directionalLight.intensity = 0f;
                EasterEggActivated         = true;
                return;
            }

            if (Input.GetKeyUp(KeyCode.E) && EasterEggActivated)
            {
                RoadRender.Get().ChangeRoadColors(true);
                var directionalLight = GameObject.Find("Directional Light").GetComponent(typeof(Light)) as Light;
                RenderSettings.skybox      = Resources.Load("Textures/Skybox_default", typeof(Material)) as Material;
                directionalLight.intensity = 1f;
                EasterEggActivated         = false;
                return;
            }
        }