Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
quick:design [2018/05/18 21:48] – pedro | quick:design [2020/02/07 11:05] – jesusmayoral | ||
---|---|---|---|
Line 135: | Line 135: | ||
- Close the editor. Remember that behaviors are automatically saved. | - Close the editor. Remember that behaviors are automatically saved. | ||
- | - Select, if needed, the `Enemy` game object and observe the behavior executor parameters. Remember that the `wanderArea` is still unestablished so the `GetRandomInArea` does not know the area where the position should be chosen from. Specifically, | + | |
+ | If needed, or if you haven' | ||
+ | |||
+ | - Select, the `Enemy` game object and observe the behavior executor parameters. Remember that the `wanderArea` is still unestablished so the `GetRandomInArea` does not know the area where the position should be chosen from. Specifically, | ||
- Select the `Floor` game object, and add it a Box collider. Set (10, 0, 10) as its size. | - Select the `Floor` game object, and add it a Box collider. Set (10, 0, 10) as its size. | ||
- Select the `Enemy` game object, and drag and drop the `Floor` into the `wanderArea` parameter. | - Select the `Enemy` game object, and drag and drop the `Floor` into the `wanderArea` parameter. | ||
Line 345: | Line 348: | ||
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 357: | ||
void Start() | void Start() | ||
{ | { | ||
- | entities = | + | entities = new List< |
- | | + | entities.Add(player); |
- | as GameObject[]); | + | |
- | entities.RemoveAll(e => e.GetComponent< | + | |
InvokeRepeating(" | InvokeRepeating(" | ||
} | } |