Beispiel #1
0
        IEnumerator emitClubbers(ClubEmitterConfig config)
        {
            int numSpawned = 0;

            while (numSpawned < config.totalToSpawn)
            {
                int numToSpawn = UnityEngine.Random.Range(config.spawnMin, config.spawnMax);
                for (int i = 0; i < numToSpawn; i++)
                {
                    Clubber prefab       = config.clubberPrefabs.RandomItem();
                    Color   clubberColor = config.colors.RandomItem();
                    Clubber c            = Instantiate(prefab);
                    spawnedItems.Add(c);
                    c.clubberRenderer.color  = clubberColor;
                    c.transform.position     = spawnArea.RandomPoint();
                    c.selectable.description = descriptions.RandomItem();
                    c.dancePosition          = danceArea.RandomPoint();
                }
                yield return(new WaitForSeconds(UnityEngine.Random.Range(config.waitSecondsMin, config.waitSecondsMax)));

                numSpawned += numToSpawn;
            }
        }
Beispiel #2
0
 public void EmitClubbers(ClubEmitterConfig config)
 {
     StartCoroutine(emitClubbers(config));
 }