示例#1
0
 private void Awake()
 {
     _animator            = GetComponent <Animator>();
     _combatSystem        = GetComponentInChildren <CombatSystem>();
     _impRecruitBehaviour = GetComponent <ImpRecruitBehaviour>();
     _impCounterBehaviour = GetComponent <ImpCounterBehaviour>();
     _leaderCallToArms    = GetComponent <LeaderCallToArms>();
     _contextSteering     = GetComponent <ContextSteering>();
     _playerMovement      = GetComponent <PlayerMovement>();
 }
 public NPCBaseState(GameObject npc)
 {
     this.npc = npc;
     steer    = npc.GetComponent <ContextSteering>();
     if (steer is null)
     {
         throw new UnassignedReferenceException("NPC must have a ContextSteering component");
     }
     stateController = npc.GetComponent <IHaveState>();
     if (stateController is null)
     {
         throw new UnassignedReferenceException("NPC must have component implementing IHaveState");
     }
 }
示例#3
0
        private void Awake()
        {
            _contextSteering = GetComponent<ContextSteering>();
            _contextSeek = GetComponent<ContextSeek>();
            _bossCombatBehaviour = GetComponent<BossCombatBehaviour>();
            _arenaBoss = GetComponent<ArenaBoss>();

            _attackInstances = new BossAttack[attackFactories.Length];

            for(int i = 0; i < attackFactories.Length; i++)
            {
                _attackInstances[i] = attackFactories[i].GetAttack();
            }
        }