Пример #1
0
    void CheckState()
    {
        if (this.desireState == PlayerStateTemplate.States.Invalid)
        {
            return;
        }

        if (this.desireState == this.currState)
        {
            return;
        }

        if (this.currState != PlayerStateTemplate.States.Invalid)
        {
            this.states[(int)this.currState].End();
        }

        this.states[(int)this.desireState].Start();

        this.currState   = this.desireState;
        this.desireState = PlayerStateTemplate.States.Invalid;

        this.parent.SetIsMovable(this.isMovable());
        this.parent.SetupAnimator(this.GetAnimator());
        this.parent.SetStaminaRecoverRate(this.GetStaminaRecover());
        this.parent.SetStaminaBurnRate(this.GetStaminaBurn());
        this.parent.SetMovePseed(this.GetSpeed());
        this.parent.SetLanternRender(this.GetLanternRender());
    }
Пример #2
0
    public void SetState(PlayerStateTemplate.States _State)
    {
        if (this.currState == _State)
        {
            return;
        }

        this.desireState = _State;
    }
Пример #3
0
    public void Init(Player _parent)
    {
        this.parent = _parent;

        this.currState   = PlayerStateTemplate.States.Invalid;
        this.desireState = PlayerStateTemplate.States.Invalid;

        for (int count = 0; count < this.states.Count; count++)
        {
            this.states[count].Init();
        }
    }