public void SnowFlakesCreating() { GameObject SF; snowFlakeTime += Random.Range(minTimeSpawnPref, maxTimeSpawnPref); SF = Instantiate(bigSnowFlakes, new Vector3(Random.Range(-2.2f, 2.2f), 6f, -2f), Quaternion.identity) as GameObject; SF.GetComponent <SpriteRenderer>().sprite = snowFlakesTextures[Random.Range(0, snowFlakesTextures.Length)]; SF.AddComponent <PolygonCollider2D>(); }
public void SpawnManySnowflakes() { GameObject SF; float y = 6f; for (int i = 0; i < 10; i++) { SF = Instantiate(bigSnowFlakes, new Vector3(Random.Range(-2.2f, 2.2f), y, -2f), Quaternion.identity) as GameObject; SF.GetComponent <SpriteRenderer>().sprite = snowFlakesTextures[Random.Range(0, snowFlakesTextures.Length)]; SF.AddComponent <PolygonCollider2D>(); y += 5; } }