// Update is called once per frame void Update() { if (lightRanges < 0) { lightRanges = 0; } if (darkMeater.value > 0) { if (lightRanges <= 0) { darkMeater.value -= Time.deltaTime * darkMeaterMultiplyer; cooldown = 1f; } else { cooldown -= Time.deltaTime; if (cooldown <= 0f) { darkMeater.value += Time.deltaTime * darkMeaterMultiplyer * 2f; } } } if (darkMeater.value <= 0) { print("You died"); death.Death(); } }
public void PlayButton() { cameraScript.canUseCamera = true; mainMenu.SetActive(false); game.SetActive(true); isInMainMenu = false; MouseLockState(true); canMove = true; int spawnLocation = PlayerPrefs.GetInt("SpawnLocation"); if (spawnLocation != 0) { startPoint.Death(); } }