Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Day Night change
  • Loading branch information
lan11001 committed Oct 10, 2013
1 parent c08744a commit c177fed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
12 changes: 6 additions & 6 deletions Guardian of Silverkeep/Assets/Scenes/Levente - Test.unity
Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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}
Expand Down
5 changes: 4 additions & 1 deletion Guardian of Silverkeep/Assets/Scripts/MasterControl.cs
Expand Up @@ -12,14 +12,16 @@ public class MasterControl : MonoBehaviour
public Material skyboxNight;
public Material skyboxDay;
private Skybox skyBox;

private Light lightChange;
// Use this for initialization
void Start ()
{
skyBox = GetComponent("Skybox") as Skybox;
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**
Expand All @@ -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)
{
Expand Down

0 comments on commit c177fed

Please sign in to comment.