コード例 #1
0
    void change_state(role_state state)
    {
        if (_state != state)
        {
            _state = state;
            switch (_state)
            {
            case role_state.idle:
            {
                animation.Play("idle");
            }
            break;

            case role_state.attack:
            {
                animation.Play("attack");
            }
            break;

            case role_state.run:
            {
                animation.Play("run");
            }
            break;

            case role_state.die:
            {
                animation.Play("die");
            }
            break;
            }
        }
    }
コード例 #2
0
 void Start()
 {
     mTrans  = transform;
     mTarget = mTrans.position;
     _state  = role_state.idle;
     animation.Play("idle");
 }