public override bool MatchedChangeCondition(AICharacterBrain _Brain) { animator = _Brain.GetComponent <Animator>(); animStateInfomation = animator.GetCurrentAnimatorStateInfo(0); if (_Brain.m_SensorManager.m_SensorData.m_HaveEnemy) { float DistanceBetweenAIAndEnemy = (_Brain.m_SensorManager.m_SensorData.m_EnemyTarget.transform.position - _Brain.m_CurrentTransform.position).sqrMagnitude; if (DistanceBetweenAIAndEnemy <= shortRangeDistance * shortRangeDistance) { for (int i = 0; i < matchAnimatorName.Length; i++) { if ((animStateInfomation.IsName(matchAnimatorName[i]))) { // Debug.Log("Stop because of" + matchAnimatorName[i]); return(false); } } return(true); } } return(false); }
public override bool MatchedChangeCondition(AICharacterBrain _Brain) { if (_Brain.m_SensorManager.m_SensorData.m_FinishedDoingCurrentLearnedBehavior) { return(true); } return(false); }
public override void Initialize(AICharacterBrain _Brain) { base.Initialize(_Brain); m_brain.m_SensorManager.m_SensorData.m_FinishedDoingCurrentLearnedBehavior = false; _Brain.m_BaseMoveManager.ChangeMoveTarget(_Brain.m_CurrentTransform); m_Animator.SetFloat("Speed", 0); m_Animator.SetTrigger(m_Skill); }
public override bool MatchedChangeCondition(AICharacterBrain _Brain) { if (_Brain.m_SensorManager.m_SensorData.m_HaveEnemy) { float DistanceBetweenAIAndEnemy = (_Brain.m_SensorManager.m_SensorData.m_EnemyTarget.transform.position - _Brain.m_CurrentTransform.position).sqrMagnitude; if (DistanceBetweenAIAndEnemy > longRangeDistance * longRangeDistance) { return(true); } } return(false); }
public override bool MatchedChangeCondition(AICharacterBrain _Brain) { //if (_Brain.GetComponent<MonsterHealth>()) //{ // if (_Brain.GetComponent<MonsterHealth>().m_CharacterHealthPoint <=injuredHealthPercent*_Brain.GetComponent<MonsterHealth>().m_CharacterOriginalHealth) // { // return true; // } //} if (_Brain.GetComponent <NPCAI.Damageable>()) { if (_Brain.GetComponent <NPCAI.Damageable>().GetHealth() <= injuredHealthPercent * _Brain.GetComponent <NPCAI.Damageable>().startHealth) { return(true); } } return(false); }
public override void Initialize(AICharacterBrain _Brain) { base.Initialize(_Brain); m_brain.m_SensorManager.m_SensorData.m_FinishedDoingCurrentLearnedBehavior = false; }