コード例 #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();
                    }
                }
            }
        }
コード例 #2
0
 void SetInitialReferences()
 {
     npcStatePattern = GetComponent <NPC_StatePattern>();
     myAnimator      = GetComponent <Animator>();
 }
コード例 #3
0
 public NPCState_Patrol(NPC_StatePattern npcStatePattern)
 {
     npc = npcStatePattern;
 }
コード例 #4
0
 public NPCState_Alert(NPC_StatePattern npcStatePattern)
 {
     npc = npcStatePattern;
 }
コード例 #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;
 }
コード例 #6
0
 public NPCState_MeleeAttack(NPC_StatePattern npcStatePattern)
 {
     npc = npcStatePattern;
 }
コード例 #7
0
 public NPCState_Follow(NPC_StatePattern npcStatePattern)
 {
     npc = npcStatePattern;
 }
コード例 #8
0
 public NPCState_Pursue(NPC_StatePattern npcStatePattern)
 {
     npc = npcStatePattern;
 }
コード例 #9
0
 public NPCState_Struck(NPC_StatePattern npcStatePattern)
 {
     npc = npcStatePattern;
 }
コード例 #10
0
 public NPCState_Flee(NPC_StatePattern npcStatePattern)
 {
     npc = npcStatePattern;
 }
コード例 #11
0
 public NPCState_RangedAttack(NPC_StatePattern npcStatePattern)
 {
     npc = npcStatePattern;
 }
コード例 #12
0
 public NPCState_InvestigateHarm(NPC_StatePattern npcStatePattern)
 {
     npc = npcStatePattern;
 }