Exemplo n.º 1
0
    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>();
    }
Exemplo n.º 2
0
    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;
        }
    }