Exemple #1
0
    /// <summary>
    /// At update, we check the various commands and send them to the player.
    /// </summary>
    void Update()
    {
        PlayerInputState input = GetInputState();

        //Pass input to relevant controllers

        if (!PlayerMovementController.advancedMovementState.broadcasting)
        {
            MovingController.Move(input.Horizontal, input.Vertical);

            if (!PlayerMovementController.advancedMovementState.recalling)
            {
                JumpingController.Jump(input.JumpDown, input.JumpUp);
            }
        }

        PlayerMovementController.Recall(input.Recall);
        Transmitter.HandleRecall(input, PlayerMovementController.advancedMovementState.recalling);

        PlayerMovementController.Broadcast(input.Broadcast);
        Transmitter.HandleBroadcast(input, PlayerMovementController.advancedMovementState.broadcasting);

        if (Input.GetButtonDown("Help"))
        {
            if (GameController.S.controlsText.enabled)
            {
                GameController.S.controlsText.enabled = false;
                GameController.S.helpText.enabled     = true;
            }
            else
            {
                GameController.S.controlsText.enabled = true;
                GameController.S.helpText.enabled     = false;
            }
        }
    }