// Use this for initialization public override void IntializeController() { base.IntializeController(); _timeCounter = new Stopwatch(); _timeLimit = new TimeSpan(0, _startMinutesLeft, _startSecondsLeft); GameScore.AddEnergy(_startEnergy); GameScore.AddOxygen(_startOxygen); CreateMap(); CreatePlayer(); }
private void UpdateOxygen() { if (_player.IsImmerse) { if (GameScore.CurrentOxygen > 0) { GameScore.AddOxygen(-_oxygenGainSpeed * Time.deltaTime); if (GameScore.CurrentOxygen <= 0) { Pause(); _player.UI.EnableGameOverPanel(UI.GameOverType.Lost); } } } else { if (GameScore.CurrentOxygen < 1) { GameScore.AddOxygen((_oxygenGainSpeed / 4f) * Time.deltaTime); } } }