mihai9323 / Jocoi

0 stars 0 forks source link

Spawn 2 grass on RMB Hold #85

Closed mihai9323 closed 9 years ago

mihai9323 commented 9 years ago

Make a script called SpawnGrassOnRMB The script should have as public variables the following: -> int numberOfGrass (the amount of grass objects to spawn) -> float holdTime (the amount of time the RMB needs to be hold done until the grass is spawned) -> Spawner[] spawnPoints (an array of empty gameobjects with the Spawner script attached to them, indicating where the grass can be spawned in the world, at random. The length of the array should be greater or equal to the numberOfGrass variable) -> GameObject grass (holds the prefab gameObject that needs to be spawned)

The script should detect if the RMB was pressed and hold for the specified amount of time. And if this happens spawn the specified amount of grass in random empty points chosen from spawnPoints array.