public void Next()
 {
     typingManager.UpdateTypingGameState(TypingGameState.Summary);
     if (SwitchScene.Instance != null)
     {
         SwitchScene.Instance.DisplayWorkProjectSummary(true);
     }
 }
Beispiel #2
0
    void Update()
    {
        switch (wordManager.GetTypingGameState())
        {
        case AlphaTypingManager.TypingGameState.PreGame:
            if (canPlaying)
            {
                timeCountDown -= Time.deltaTime * Time.timeScale;
                OnAlphaTypingTimerUpdate?.Invoke();
                if (timeCountDown <= minTimeCountDown)
                {
                    timeCountDown = maxtimeCoutDown;
                    wordManager.UpdateTypingGameState(AlphaTypingManager.TypingGameState.Playing);
                }
            }
            break;

        case AlphaTypingManager.TypingGameState.Playing:
            OnAlphaTypingTimerUpdate?.Invoke();
            gameTime += Time.deltaTime * Time.timeScale;

            if (gameTime >= maxTotalTime)
            {
                playerManager.TimeOut();
                break;
            }

            if (playerManager.PlayerState == AlphaTypingPlayerManager.AlphaPlayerState.Alive)
            {
                timeCountGenerator += Time.deltaTime * Time.timeScale;
                if (timeCountGenerator >= cooldown[wordManager.CurrentLevel] && amountGenerator > 0)
                {
                    GeneratedBox();
                    timeCountGenerator = 0;
                }
            }
            break;
        }
    }