Example #1
0
    private void OnAlphaTypingTimerUpdateHandler()
    {
        switch (typingGameManager.GetTypingGameState())
        {
        case AlphaTypingManager.TypingGameState.PreGame:
            SetPregameCountdownTime();
            break;

        case AlphaTypingManager.TypingGameState.Playing:
            SetTimeFillBar();
            break;
        }
    }
    void Update()
    {
        switch (wordManager.GetTypingGameState())
        {
        case AlphaTypingManager.TypingGameState.PreGame:
            if (Input.GetKeyDown(KeyCode.Space))
            {
                wordManager.PlaysGame();
            }
            break;

        case AlphaTypingManager.TypingGameState.Playing:
            foreach (char letter in Input.inputString)
            {
                wordManager.TypeLetterManager(letter);
            }
            break;
        }
    }
Example #3
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;
        }
    }