Ejemplo n.º 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();
                    }
                }
            }
        }
Ejemplo n.º 2
0
 void SetInitialReferences()
 {
     npcStatePattern = GetComponent <NPC_StatePattern>();
     myAnimator      = GetComponent <Animator>();
 }
Ejemplo n.º 3
0
 public NPCState_Patrol(NPC_StatePattern npcStatePattern)
 {
     npc = npcStatePattern;
 }
Ejemplo n.º 4
0
 public NPCState_Alert(NPC_StatePattern npcStatePattern)
 {
     npc = npcStatePattern;
 }
Ejemplo n.º 5
0
 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;
 }
Ejemplo n.º 7
0
 public NPCState_Follow(NPC_StatePattern npcStatePattern)
 {
     npc = npcStatePattern;
 }
Ejemplo n.º 8
0
 public NPCState_Pursue(NPC_StatePattern npcStatePattern)
 {
     npc = npcStatePattern;
 }
Ejemplo n.º 9
0
 public NPCState_Struck(NPC_StatePattern npcStatePattern)
 {
     npc = npcStatePattern;
 }
Ejemplo n.º 10
0
 public NPCState_Flee(NPC_StatePattern npcStatePattern)
 {
     npc = npcStatePattern;
 }
 public NPCState_RangedAttack(NPC_StatePattern npcStatePattern)
 {
     npc = npcStatePattern;
 }
Ejemplo n.º 12
0
 public NPCState_InvestigateHarm(NPC_StatePattern npcStatePattern)
 {
     npc = npcStatePattern;
 }