|
Post by mattinjersey on Mar 8, 2020 21:19:58 GMT
Can you explain how the ExampleScene works. I don't see where it calls the code to spawn/ despawn objects. Thanks Matt
|
|
|
Post by DarkTonic Dev on Mar 8, 2020 21:52:34 GMT
Look at the script PB_Instructions.cs which is on the Main Camera game object. There are spawn and despawn codes in there for buttons.
|
|
|
Post by mattinjersey on Mar 8, 2020 23:05:50 GMT
ok by the way why did you put the script onto the camera.
|
|
|
Post by DarkTonic Dev on Mar 8, 2020 23:09:36 GMT
Well its just UI buttons. It could go anywhere. It doesn't need its own Game Object.
|
|
|
Post by mattinjersey on Mar 8, 2020 23:13:29 GMT
If I understand correctly, the variable robotKylePrefab did not have to be initialized. And robotKylePrefab.rotation did not have to be initialized.
|
|
|
Post by mattinjersey on Mar 8, 2020 23:27:52 GMT
Also is there an example of how to despawn 1 instance. for example, lets say Robot1 gets shot. How to despawn it.
|
|
|
Post by mattinjersey on Mar 8, 2020 23:38:11 GMT
no I see that the robotKyleprefab is set in the inspector.
|
|
|
Post by DarkTonic Dev on Mar 9, 2020 3:29:24 GMT
Yes, robotKylePrefab is a public variable, so it's set by dragging the prefab into the Inspector.
To despawning an instance, you do so from the game object you are despawning, and call PoolBoss.Despawn(this.transform);
|
|