コード例 #1
0
 private void InitialiseUI()
 {
     OnScoreChanged?.Invoke(newText: _currentGameStats.Score.ToString());
     OnCountDown?.Invoke(newText: "");
     StartPauseWatch?.Invoke("");
     OnAmmoChange?.Invoke(newText: _currentGameStats.Ammo.ToString());
 }
コード例 #2
0
    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();
    }
コード例 #3
0
    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;
                }
            }
        });
    }
コード例 #4
0
 public void CountDown(int userInput)
 {
     Thread.Sleep(userInput);
     OnCountDown?.Invoke();
 }