Example #1
0
 protected override void OnStart()
 {
     _animatorComp   = GetComponent <Animator>();
     _sceneCharacter = GetComponent <SceneCharacter>();
     _mover          = new NPCMover(this, GetComponent <UnitPathfinder>(), GetComponent <CorvoPathFinder>());
     _attacker       = new NPCAttacker(this);
     TheBrain        = new NPCAI(Type, _sceneCharacter.TheCharacter, this, _mover, _attacker);
     _internalTimer  = 0;
 }
Example #2
0
 public NPCAI(string aType, LivingCharacter aCharacter, SceneNPC aSceneNPC, NPCMover aMover, NPCAttacker anAttacker)
 {
     Config         = FPPGame.FPPGameModuleManager.Instance.FindEnemyData(aType);
     _character     = aCharacter;
     _thinkingTimer = 0;
     _bodyStayTimer = 0;
     _firstUpdate   = true;
     _sceneNPC      = aSceneNPC;
     _attacker      = anAttacker;
     _mover         = aMover;
     try
     {
         CurrentAttidude = (Attidude)Enum.Parse(typeof(Attidude), (string)Config["baseAttidude"]);
     } catch (Exception)
     {
         CurrentAttidude = Attidude.Neutral;
     }
 }