From c177fed86b725df25ac1daf4fee07b7539d312fd Mon Sep 17 00:00:00 2001 From: Levente Nagy Date: Wed, 9 Oct 2013 21:11:35 -0400 Subject: [PATCH] Day Night change --- .../Assets/Scenes/Levente - Test.unity | 12 ++++++------ .../Assets/Scripts/MasterControl.cs | 5 ++++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Guardian of Silverkeep/Assets/Scenes/Levente - Test.unity b/Guardian of Silverkeep/Assets/Scenes/Levente - Test.unity index cc0f524..24d1ad1 100644 --- a/Guardian of Silverkeep/Assets/Scenes/Levente - Test.unity +++ b/Guardian of Silverkeep/Assets/Scenes/Levente - Test.unity @@ -157504,7 +157504,7 @@ GameObject: - 4: {fileID: 1955668373} - 108: {fileID: 1955668372} m_Layer: 0 - m_Name: nighttime light + m_Name: sun m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -157518,10 +157518,10 @@ Light: m_GameObject: {fileID: 1955668371} m_Enabled: 1 serializedVersion: 3 - m_Type: 1 - m_Color: {r: .288062274, g: .30998686, b: .352941155, a: 1} - m_Intensity: .99000001 - m_Range: 162.590744 + m_Type: 2 + m_Color: {r: .860294104, g: .801661491, b: .556660891, a: 1} + m_Intensity: 1.51999998 + m_Range: 500 m_SpotAngle: 98 m_CookieSize: 10 m_Shadows: @@ -157552,7 +157552,7 @@ Transform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1955668371} m_LocalRotation: {x: .707106829, y: 0, z: 0, w: .707106829} - m_LocalPosition: {x: -12.5799999, y: 124.610001, z: 0} + m_LocalPosition: {x: -12.5799999, y: 139.274612, z: 1.74815887e-06} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 405045982} diff --git a/Guardian of Silverkeep/Assets/Scripts/MasterControl.cs b/Guardian of Silverkeep/Assets/Scripts/MasterControl.cs index af089e1..310012c 100644 --- a/Guardian of Silverkeep/Assets/Scripts/MasterControl.cs +++ b/Guardian of Silverkeep/Assets/Scripts/MasterControl.cs @@ -12,7 +12,7 @@ public class MasterControl : MonoBehaviour public Material skyboxNight; public Material skyboxDay; private Skybox skyBox; - + private Light lightChange; // Use this for initialization void Start () { @@ -20,6 +20,8 @@ public class MasterControl : MonoBehaviour hero = (FPS_HERO)FindObjectOfType(typeof(FPS_HERO)); eGen = GameObject.FindGameObjectsWithTag("Respawn"); skyBox.material = skyboxNight; + lightChange = GameObject.Find("sun").GetComponent("Light") as Light; + lightChange.enabled = false; } //*** put swap skybox somewhere here** @@ -40,6 +42,7 @@ public class MasterControl : MonoBehaviour if(hero.Score >= (0.7f * Win_Cond)) { skyBox.material = skyboxDay; + lightChange.enabled = true; foreach(GameObject e in eGen) {