Пример #1
0
 public void Attack(int skillID, bool enable = true)
 {
     if (enable)
     {
         SkillMgr.ReleaseSkill(skillID,
                               () => { curState = PlayerState.Fight; isAbleMove = false; },
                               () => {
             curState = PlayerState.Idle; isAbleMove = true;
             AnimMgr.Reset();
             GameTools.LogError("ReleaseSkill Finish!!!");
         }
                               );
     }
 }
Пример #2
0
    public void PlayerMove()
    {
        float h = Input.GetAxis("Horizontal");
        float v = Input.GetAxis("Vertical");

        if ((Mathf.Abs(v) < minResponseVal && Mathf.Abs(h) < minResponseVal))
        {
            MoveCtrl.ResetState();
            AnimMgr.Reset();
            curState = PlayerState.Idle;
        }
        else
        {
            curState = PlayerState.Move;
            MoveCtrl.Move(h * speed, v * speed);
            AnimMgr.PlayRun();
        }
    }