Start and Update Function of the GameManager Script
Here is a gist of SpawnGameObject Script. This script basically spawns different blocks that players can shoot in the game. The script comprises of 3 functions Start(), Update(), and MakeThingToSpawn(). The Start function is called only once when the game starts, and it determines when to spawn the next object, while the update function is called every second of the game and based on the time it calls the MakeThingToSpawn function. In MakeThingsToSpawn, the function randomly determines the object's x y and z coordinates, selects an object from the prefabs, and spawns the selected prefab at the randomly selected coordinates.