Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revisionBoth sides next revision
quick:design [2018/05/18 21:48] pedroquick:design [2018/11/15 10:39] – [In Behavior Bricks efficiency matters] pedro
Line 345: Line 345:
         public GameObject prefab;         public GameObject prefab;
         public GameObject wanderArea;         public GameObject wanderArea;
 +        public GameObject player;
 +
  
         public int Spawns = 750;         public int Spawns = 750;
Line 352: Line 354:
         void Start()         void Start()
         {         {
-            entities =  +            entities = new List<GameObject>(); 
-              new List<GameObject>(FindObjectsOfType(typeof(GameObject))  +            entities.Add(player);
-                as GameObject[]); +
-            entities.RemoveAll(e => e.GetComponent<BehaviorExecutor>() == null);+
             InvokeRepeating("Spawn", 0f, 1.0f / 1000.0f);             InvokeRepeating("Spawn", 0f, 1.0f / 1000.0f);
         }         }