Example #1
0
 public void Update()
 {
     if (Input.GetKeyUp(KeyCode.D))
     {
         _Player.SwitchState(new Idle(_Player));
     }
     if (Input.GetKeyDown(KeyCode.A))
     {
         _Player.SwitchState(new FWalk(_Player));
     }
     if (Input.GetKeyDown(KeyCode.W))
     {
         _Player.SwitchState(new Jump(_Player));
     }
 }
Example #2
0
 public void Update()
 {
     if (_Player._Collision._Grounded == true)
     {
         _Player.SwitchState(new Idle(_Player));
     }
 }
Example #3
0
 public void Update()
 {
     if (_Player._Collision._Grounded == false && _Player._Velocity.y < 0)
     {
         _Player.SwitchState(new Falling(_Player));
     }
 }
Example #4
0
 public void Update()
 {
     if (Input.GetKeyUp(KeyCode.S))
     {
         _Player.SwitchState(new Idle(_Player));
     }
 }
Example #5
0
    public void Update()
    {
        switch (GameManager.instance.InputManager.GetDirection(_Player.m_ControllerId).notation)
        {
        case DirectionNotaton.Up:
            _Player.SwitchState(new Jump(_Player));
            break;

        case DirectionNotaton.UpLeft:
            _Player.SwitchState(new FWalk(_Player));
            break;

        case DirectionNotaton.UpRight:
            _Player.SwitchState(new BWalk(_Player));
            break;

        case DirectionNotaton.Neutral:
            _Player.SwitchState(new Idle(_Player));
            break;

        case DirectionNotaton.Left:
            _Player.SwitchState(new FWalk(_Player));
            break;

        case DirectionNotaton.Right:
            _Player.SwitchState(new BWalk(_Player));
            break;
        }
    }
Example #6
0
    public void Update()
    {
        if (Input.GetKeyDown(KeyCode.S))
        {
            _Player.SwitchState(new Crouch(_Player));
        }

        if (Input.GetKeyDown(KeyCode.A) || Input.GetKey(KeyCode.A))
        {
            _Player.SwitchState(new FWalk(_Player));
        }

        if (Input.GetKeyDown(KeyCode.D) || Input.GetKey(KeyCode.D))
        {
            _Player.SwitchState(new BWalk(_Player));
        }

        if (Input.GetKeyDown(KeyCode.W))
        {
            _Player.SwitchState(new Jump(_Player));
        }
    }