Commit 21cb683d authored by radow's avatar radow
Browse files

push push

parent 6a86ec92
This diff is collapsed.
......@@ -35,7 +35,7 @@ public class Endzone : MonoBehaviour
public void DoTurenOffLamp()
{
PlayerController.thePlayer.GetComponentInChildren<Lamp>().TurnOffLamp();
Lamp.instance.TurnOffLamp();
VA.Play();
done = true;
......
......@@ -11,14 +11,18 @@ public class VAZone : MonoBehaviour
public static bool statuesdone;
public static int count = 0;
public int localcount = 0;
public bool amTemple;
public bool amS1;
public bool amFar;
public bool ready;
bool done;
public bool inRange;
private void OnTriggerEnter(Collider other)
{
inRange = true;
if (true)
{
if (amTemple && !temple) { temple = true; count++; }
......@@ -32,8 +36,14 @@ public class VAZone : MonoBehaviour
GetComponent<AudioSource>().volume = 4f;
GetComponent<AudioSource>().Play();
}
localcount = count;
}
}
private void OnTriggerExit(Collider other)
{
inRange = false;
}
}
......@@ -32,13 +32,25 @@ public class VRGamestate : MonoBehaviour
public VRPauseMenu pauseMenu;
public GameObject vrUIRay;
Light[] lightsources;
float[] intens;
public void LoseGame()
{
Color a = looseText.color;
a.a += Time.deltaTime * fadespeed;
looseText.color = a;
for (int i = 0; i < lightsources.Length; i++) lightsources[i].intensity = intens[i] * (1 - a.a);
if (end) return;
//
var particlesystems = FindObjectsOfType<ParticleSystem>();
foreach (ParticleSystem ps in particlesystems) ps.Stop();
lightsources = FindObjectsOfType<Light>();
intens = new float[lightsources.Length];
for(int i = 0; i< lightsources.Length; i++)
{
intens[i] = lightsources[i].intensity;
}
//
pauseMenu.SetPostion();
end = true;
LoseScreen.SetActive(true);
......@@ -56,6 +68,7 @@ public class VRGamestate : MonoBehaviour
winText.color = a;
// activate Winmenu
if (end) return;
Endzone.instance.TurnOfLamp();
end = true;
SettingsData.instance.paused = true;
Invoke("ShowWinmenu" , 2);
......
......@@ -14,6 +14,7 @@ public class VRPauseMenu : MonoBehaviour
//Menu
public GameObject vrUIRay;
public GameObject pauseMenuCanvas;
public GameObject SettingsCanvas;
bool menuActive;
void Start()
......@@ -57,6 +58,7 @@ public class VRPauseMenu : MonoBehaviour
SettingsData.instance.paused = false;
pauseMenuCanvas.SetActive(false);
vrUIRay.SetActive(false);
SettingsCanvas.SetActive(false);
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment