// Update is called once per frame
        void Update()
        {
            if (darumasanGameController.GetCurrentGameState() == GameState.Winner ||
                darumasanGameController.GetCurrentGameState() == GameState.GameSet)
            {
                return;
            }

            ghostMessageText.text = ghostMessageToShow.Substring(0, characterIndex);

            GetPlayerHitButtonDown(playerID);
        }
Exemplo n.º 2
0
        // Update is called once per frame
        void Update()
        {
            GameState currentGameState = darumasan1v3GameController.GetCurrentGameState();

            if (currentGameState != GameState.GameStart && currentGameState != GameState.GhostMessageEnded)
            {
                return;
            }

            playerLife = playerInfo.GetCurrentLife(playerID);
            if (playerLife <= 0)
            {
                return;
            }

            if (playerInputMethod == PlayerControllerInput.Keyboard)
            {
                if (Input.GetKeyDown(runKeyCodeKeyboard))
                {
                    if (currentGameState == GameState.GameStart)
                    {
                        darumasan1v3GameController.HandlePlayersInputRun(playerID);
                    }
                    else if (currentGameState == GameState.GhostMessageEnded)
                    {
                        playerIsRunning = true;
                    }
                }
                else
                {
                    playerInputTimer += Time.deltaTime;
                    if (playerInputTimer >= playerStandTimer)
                    {
                        playerInputTimer = 0;
                        darumasan1v3GameController.PlayerStand(playerID);
                    }
                }
            }
            else if (playerInputMethod == PlayerControllerInput.Joystick)
            {
                if (Input.GetButtonDown("DarumasanP" + (playerID + 1) + "RunButton"))
                {
                    if (currentGameState == GameState.GameStart)
                    {
                        darumasan1v3GameController.HandlePlayersInputRun(playerID);
                    }
                    else if (currentGameState == GameState.GhostMessageEnded)
                    {
                        playerIsRunning = true;
                    }
                }
                else
                {
                    playerInputTimer -= Time.deltaTime;
                    if (playerInputTimer <= 0f)
                    {
                        playerInputTimer += playerStandTimer;
                        darumasan1v3GameController.PlayerStand(playerID);
                    }
                }
            }
        }