Ejemplo n.º 1
0
    public override CharacterState UpdataState(Character character, InputOrder input)
    {
        CharacterState tempState = this;

        if (!character.OnGround())
        {
            tempState = new JumpState();
        }
        else
        {
            switch (input)
            {
            case InputOrder.stand:
                tempState = new IdleState();
                break;

            case InputOrder.jump:
                character.DoJump();
                tempState = new JumpState();
                break;

            case InputOrder.squat:
                tempState = new SquatState();
                break;
            }
        }

        return(tempState);
    }
Ejemplo n.º 2
0
    public override CharacterState UpdataState(Character character, InputOrder input)
    {
        CharacterState tempState = this;

        if (character.OnGround())
        {
            //Debug.Log("On Ground Now.");
            switch (input)
            {
            case InputOrder.stand:
                tempState = new IdleState();
                break;

            case InputOrder.walk:
                tempState = new WalkState();
                break;

            case InputOrder.squat:
                tempState = new SquatState();
                break;

            default:
                tempState = new IdleState();
                break;
            }
        }

        return(tempState);
    }
Ejemplo n.º 3
0
 private SquatState()
 {
     if (_instance != null)
     {
         return;
     }
     _instance = this;
 }
Ejemplo n.º 4
0
    public override CharacterState UpdataState(Character character, InputOrder input)
    {
        CharacterState tempState = this;

        switch (input)
        {
        case InputOrder.jump:
            character.DoJump();
            tempState = new JumpState();
            break;

        case InputOrder.walk:
            tempState = new WalkState();
            break;

        case InputOrder.squat:
            tempState = new SquatState();
            break;
        }

        return(tempState);
    }