Exemple #1
0
 public void SpawnAI()
 {
     for (int i = 0; i < numAI; i++)
     {
         AIBehaviour newAI = Instantiate(AIPrefab, AISpawnLocation.position, AISpawnLocation.rotation).GetComponent <AIBehaviour>();
         newAI.agent.Warp(AIManager.instance.AISpawnLocation.position);
         newAI.transform.SetParent(AIHeirarchyLocation);
         newAI.myInformation = AIInformation[i];
         newAI.gameObject.SetActive(false);
         newAI.Init();
         preGeneratedAI.Add(newAI.myInformation.id, newAI.gameObject);
     }
 }
 public void SetBehaviour(AIBehaviour behaviour)
 {
     behave = Instantiate(behaviour);
     behave.Init(this.gameObject, this);
 }