void OnTriggerEnter(Collider Target) { if (Target.collider.tag == "Player") { FlashLight.UpdateBattery(50, true); Destroy(this.gameObject); } }
public static void RestartGame() { // return player to above the grid GameObject fpc = GameObject.Find("First Person Controller"); fpc.transform.position = new Vector3(0, 3, 0); // reset first person health fpc.GetComponent <CharacterScript> ().ResetHealth(); OnScreenDisplay.SetHealthPoints(100, false); // reset flashlight value FlashLight.UpdateBattery(100, false); // set game mode mode = GameMode.StartMenu; }