void Start()
{
//check if num spawners is divisible by num Sections
float theta = Mathf.PI * 2 / numSpawners;
float radius = gm.GetDistFromCenter();
for( int i = 0; i < numSpawners; ++i )
{
float angle = theta * i;
Vector3 sPos = new Vector3( radius * Mathf.Sin(angle) , 1, radius * Mathf.Cos(angle));
GameObject go = (GameObject)Instantiate(spawnerPrefab, sPos, Quaternion.identity);
go.GetComponent<SpawnerZone>().SetManagers( gm, this );
go.SetActive(false);
if( i == 0 )
go.GetComponent<SpawnerZone>().SkipFirstCollision();
spawners.Add( go ) ;
}
for( int i = 0; i < targetPrefabs.Count * 3; ++i )
{
GameObject go = (GameObject)Instantiate( targetPrefabs[i/3], Vector3.zero, Quaternion.identity );
go.SetActive(false);
targets.Add(go);
}
for( int i = 0; i < badTargetPrefabs.Count * 3; ++i )
{
GameObject go = (GameObject)Instantiate( badTargetPrefabs[i/3], Vector3.zero, Quaternion.identity );
go.SetActive(false);
badTargets.Add(go);
}
Physics.gravity = new Vector3 (0, -gameGravity, 0);
}