public void ShowStun() { GetAnimator().SetTrigger("Stun"); _navMeshAgent.enabled = false; if (m_Health == MapRoleHealth.Normal) { m_Health = MapRoleHealth.Stun; } }
public void ShowDeath(int deathCode = -1) { //简单粗暴,直接删除GameObject,回头有空再实现死亡动作 GameObject.Destroy(this.gameObject); //默认播放随机死亡动作 //if (deathCode == -1) deathCode = ToolsShared.GetRandomInt(0, 2); //GetAnimator().SetTrigger("Death"); //GetAnimator().SetInteger("DeathType", (int)deathCode); m_Health = MapRoleHealth.Death; }
public void StopStun(bool isInBattle) { GetAnimator().ResetTrigger("Stun"); if (isInBattle) { _navMeshAgent.enabled = false; GetAnimator().SetTrigger("Idle"); } else { _navMeshAgent.enabled = true; GetAnimator().SetTrigger("LeaveBattle"); } if (m_Health != MapRoleHealth.Death) { m_Health = MapRoleHealth.Stun; } }