Example #1
0
 public CrouchProxy(IStateProxy playerState, IToggleProxySprintMediator sprintProxyToggleMediator)
 {
     _IsInputActive        = false;
     _StatePlayer          = playerState;
     _SprintToggleMediator = sprintProxyToggleMediator;
     _CommandCrouch        = new CrouchCommand();
 }
Example #2
0
 private void Start()
 {
     rightCom       = new RightCommand();
     leftCom        = new LeftCommand();
     attackCom      = new AttackCommand();
     jumpCom        = new JumpCommand();
     crouchCom      = new CrouchCommand();
     idleCom        = new IdleCommand();
     specialCom     = new SpecialCommand();
     altSpecialCom  = new AltSpecialCommand();
     mindControlCom = new MindControlCommand();
 }
    public Command HandleInput()
    {
        if (Input.GetAxis("Jump") != 0)
        {
            // Significa que estoy queriendo saltar.
            CmdJump = new JumpCommand();
            return(CmdJump);
        }

        if (Input.GetKeyDown(KeyCode.C))
        {
            CmdCrouch = new CrouchCommand();
            return(CmdCrouch);
        }

        if (Input.GetAxis("Horizontal") == 0 && Input.GetAxis("Vertical") == 0)
        {
            CmdIdle = new IdleCommand();
            return(CmdIdle);
        }

        if (Input.GetKeyDown(KeyCode.E))
        {
            CmdPickUp = new PickUpCommand();
            return(CmdPickUp);
        }

        if (((Input.GetAxis("Horizontal") != 0 || Input.GetAxis("Vertical") != 0)))
        {
            CmdMove = new MoveCommand();
            MoveCommand.rotation    = Input.GetAxis("Horizontal");
            MoveCommand.translation = Input.GetAxis("Vertical");
            return(CmdMove);
        }

        return(null);       // Si presiono algo que no sea lo que esta arriba GG.
    }