private void InitialiseUI() { OnScoreChanged?.Invoke(newText: _currentGameStats.Score.ToString()); OnCountDown?.Invoke(newText: ""); StartPauseWatch?.Invoke(""); OnAmmoChange?.Invoke(newText: _currentGameStats.Ammo.ToString()); }
public IEnumerator CountDownTimer() { float timer = 3; while (timer > 0) { OnCountDown?.Invoke(newText: Mathf.Round(timer).ToString()); timer -= Time.deltaTime; yield return(null); } OnCountDown?.Invoke(newText: ""); _drawCaveWall.BeginDraw(); OnGameStart(); }
public static void Restart() { Eitrum.Engine.Core.Timer.Stop(endGameRestartRoutine); Parent.DestroyAllChildren(); roundTimer = GameSettings.RoundDuration; SpawnPlayers(); OnRestart?.Invoke(); int counter = 3; Eitrum.Engine.Core.Timer.Repeat(1f, counter, () => { counter -= 1; OnCountDown.Invoke(counter); if (counter == 0) { OnRoundStart?.Invoke(); for (int iPlayer = 0, nPlayer = players.Count; iPlayer < nPlayer; ++iPlayer) { players[iPlayer].canMove = true; players[iPlayer].rb.isKinematic = false; } } }); }
public void CountDown(int userInput) { Thread.Sleep(userInput); OnCountDown?.Invoke(); }