Starting the Game after destroying the Asteroid.
At the moment we have:
in the Start method of our SpawnManager script. We need to create a new method in the script like:
In our Asteroid script we will need to add a variable:
Then in the Start method cache a reference to _spawnManager like:
Now we just need to add the following to the OnTriggerEnter method if (other.tag is “Laser”):
Saving the script and jumping back into Unity and running the game will give: