hey, sorry about the stupid title, couldn't really think of what to call this... heres the code:
var count : float = 0;
var random : int = Random.Range(1,5);
var planePrefab : Transform;
function Update()
{
count++;
if(count >= 1000)
{
count = 0;
CreatePlane();
random = Random.Range(1,5);
}
}
function CreatePlane()
{
switch(random)
{
case 5:
Instantiate( planePrefab, GameObject.Find("Spawner5").transform.position, Quaternion.identity);
break;
case 4:
Instantiate( planePrefab, GameObject.Find("Spawner4").transform.position, Quaternion.identity);
break;
case 3:
Instantiate( planePrefab, GameObject.Find("Spawner3").transform.position, Quaternion.identity);
break;
case 2:
Instantiate( planePrefab, GameObject.Find("Spawner2").transform.position, Quaternion.identity);
break;
case 1:
Instantiate( planePrefab, GameObject.Find("Spawner1").transform.position, Quaternion.identity);
break;
}
}
what I want is to remove an option from the switch list, then, when all are gone, start again in a random order.