Beispiel #1
0
        public override void Initialize()
        {
            Init();
            if (GetComponent <AIModule>() == null)
            {
                Behavior = gameObject.AddComponent <AIModule>();
            }
            AITemplate template = new SwarmAITemplate();

            template.Initialize(this);
            Behavior.SetTemplate(template);
            Behavior.Enabled = true;
            Agent            = GetComponent <NavMeshAgent>();
        }
Beispiel #2
0
 public override void Initialize()
 {
     Init();
     if (GetComponent <BehaviourTree>() == null)
     {
         AITemplate template;
         if (BehaviorTemplate != null)
         {
             template = ScriptableObject.CreateInstance(BehaviorTemplate.GetClass()) as AITemplate;
         }
         else
         {
             template = StandardAITemplate.CreateInstance <StandardAITemplate>();
         }
         template.Initialize(this);
         Behavior.SetTemplate(template);
         Behavior.Enabled = true;
     }
 }