Ejemplo n.º 1
0
    public void HandeInput(InputDown inputDown)
    {
        IMoveState moveState = _moveState.HandleInput(this, inputDown);

        if (moveState != null)
        {
            _moveState.Exit(this);
            _moveState = moveState;
            _moveState.Enter(this);
        }
        _moveState.Update(this);
    }
Ejemplo n.º 2
0
 public override IMoveState HandleInput(Player player, InputDown inputDown)
 {
     if (inputDown == InputDown.w)
     {
         return(new MoveForward());
     }
     else if (inputDown == InputDown.s)
     {
         return(new MoveBack());
     }
     else if (inputDown == InputDown.d)
     {
         return(new MoveRight());
     }
     else if (inputDown == InputDown.a)
     {
         return(new MoveLeft());
     }
     return(null);
 }
Ejemplo n.º 3
0
 public InputInstance(Jewel inputOn)
 {
     InputDown = new InputDown(inputOn.gameObject);
 }
Ejemplo n.º 4
0
 public virtual IMoveState HandleInput(Player player, InputDown inputDown)
 {
     return(null);
 }