Esempio n. 1
0
    // 获取当前被动状态aa
    public sdBaseState GetCurrentPassiveState()
    {
        if (_gameActor.GetCurrentHP() <= 0)
        {
            return(die);
        }

        if (_gameActor._moveVector.sqrMagnitude > 0.001f)
        {
            return(run);
        }

        return(idle);
    }
Esempio n. 2
0
 // Update is called once per frame
 void Update()
 {
     current += Time.deltaTime;
     if (current > Life)
     {
         Callback();
         GameObject.Destroy(gameObject);
     }
     else if (actor != null)
     {
         if (actor.GetCurrentHP() <= 0)
         {
             Callback();
             GameObject.Destroy(gameObject);
         }
     }
 }
Esempio n. 3
0
 // 检查是否进入自动战斗处理aa
 protected virtual bool IsNeedUpdate()
 {
     if (mEnable == false)
     {
         return(false);                      //< 自动战斗被禁用aa
     }
     if (mActor == null)
     {
         return(false);                      //< 角色被清除aa
     }
     if (mActor.GetCurrentHP() <= 0)
     {
         return(false);                      //< 角色已死亡aa
     }
     if (mActor.CheckDebuffState(HeaderProto.ECreatureActionState.CREATURE_ACTION_STATE_STUN))
     {
         return(false);                      //< 角色进入昏迷状态aa
     }
     return(true);
 }