private void Update() { if (!gameStarted || endGame.gameEnded) { return; } if (Input.GetButtonDown("Exit")) { Continue(); } if (Anger > uncomfortableBossThreshold) { playerSweatParticleSystem.Play(true); } else { playerSweatParticleSystem.Stop(true, ParticleSystemStopBehavior.StopEmitting); } if (boxesInScreen * angerIncreasePerBox + _anger >= 100.0f) { playerWon = false; endGame.EndGame(); } }
private void Update() { if (!started || endGame.gameEnded) { return; } int wave = (int)Math.Floor(wavesCurve.Evaluate(totalTime)); if (wave != lastWave) { SpawnWave(wave); lastWave = wave; } int display = (int)Mathf.Floor(displayModeSwapCurve.Evaluate(totalTime)); if (display != lastDisplayModeSwap) { gm.SwapDisplays(); lastDisplayModeSwap = display; } totalTime += Time.deltaTime; int remaining = (int)(totalGameTime - totalTime); string remainingH = (remaining / 60).ToString(); string remainingM = (remaining % 60).ToString(); if (remainingM.Length < 2) { remainingM = "0" + remainingM; } timerText.text = "0" + remainingH + ":" + remainingM; if (remaining < 30) { timerText.text = "<color=\"yellow\">" + "0" + remainingH + ":" + remainingM + "</color>"; } if (totalTime >= totalGameTime) { gm.playerWon = true; endGame.EndGame(); } }