void AlertNearbyAllies() { foreach (Collider ally in friendlyColliders) { if (ally.transform.root.GetComponent <NPC_StatePattern>() != null) { NPC_StatePattern allyPattern = ally.transform.root.GetComponent <NPC_StatePattern>(); if (allyPattern.currentState == allyPattern.patrolState) { allyPattern.pursueTarget = npc.myAttacker; allyPattern.locationOfInterest = npc.myAttacker.position; allyPattern.currentState = allyPattern.investigateHarmState; allyPattern.npcMaster.CallEventNpcWalkAnim(); } } } }
void SetInitialReferences() { npcStatePattern = GetComponent <NPC_StatePattern>(); myAnimator = GetComponent <Animator>(); }
public NPCState_Patrol(NPC_StatePattern npcStatePattern) { npc = npcStatePattern; }
public NPCState_Alert(NPC_StatePattern npcStatePattern) { npc = npcStatePattern; }
private void Start() { npcStatePattern = gameObject.transform.root.GetComponent <NPC_StatePattern>(); npcMaster = gameObject.transform.root.GetComponent <NPC_Master>(); head = (head == null) ? npcStatePattern.head : head; }
public NPCState_MeleeAttack(NPC_StatePattern npcStatePattern) { npc = npcStatePattern; }
public NPCState_Follow(NPC_StatePattern npcStatePattern) { npc = npcStatePattern; }
public NPCState_Pursue(NPC_StatePattern npcStatePattern) { npc = npcStatePattern; }
public NPCState_Struck(NPC_StatePattern npcStatePattern) { npc = npcStatePattern; }
public NPCState_Flee(NPC_StatePattern npcStatePattern) { npc = npcStatePattern; }
public NPCState_RangedAttack(NPC_StatePattern npcStatePattern) { npc = npcStatePattern; }
public NPCState_InvestigateHarm(NPC_StatePattern npcStatePattern) { npc = npcStatePattern; }