public void ResetLevel() { // Save info and reload the level hitBox.EndGame(true); GameObject.Find("[CameraRig]").transform.Find("Camera").GetComponent <EyeFadeControl>().CloseEyes(2); this.Unpause(); forceClose = true; }
void Update() { // If both hands are in then set the material to be the right color and set the timer to stay at 0 if (leftHand.GetControllerLeftIn() == true && rightHand.GetControllerRightIn() == true) { rend.material = mat[0]; alertText.gameObject.SetActive(false); outTimer = 0; } else // If one of the hands is out set the material to a warning color and start counting down the time till they lose { rend.material = mat[1]; if (gameStarted == true) { alertText.gameObject.SetActive(true); outTimer += Time.deltaTime; } } // If the game has started if (gameStarted == true) { // If the hands have been out for more than 2.5 seconds reset the game if (outTimer >= 5) { phb.EndGame(); } } }