Example #1
0
        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();
                    }
                }
            }
        }
Example #2
0
 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;
 }
Example #7
0
 public NPCState_Follow(NPC_StatePattern npcStatePattern)
 {
     npc = npcStatePattern;
 }
Example #8
0
 public NPCState_Pursue(NPC_StatePattern npcStatePattern)
 {
     npc = npcStatePattern;
 }
Example #9
0
 public NPCState_Struck(NPC_StatePattern npcStatePattern)
 {
     npc = npcStatePattern;
 }
Example #10
0
 public NPCState_Flee(NPC_StatePattern npcStatePattern)
 {
     npc = npcStatePattern;
 }
 public NPCState_RangedAttack(NPC_StatePattern npcStatePattern)
 {
     npc = npcStatePattern;
 }
Example #12
0
 public NPCState_InvestigateHarm(NPC_StatePattern npcStatePattern)
 {
     npc = npcStatePattern;
 }