void Spawn() { if (randomness == RandomType.Seeded) { RandomF.Push(seed++); } else if (randomness == RandomType.Perlin) { Vector3 pos = transform.position; RandomF.Push((int)(SEEDSCALE * PerlinNoise.GetValue(pos.x, pos.z))); } int num = Random.Range(minNum, maxNum); for (int i = 0; i < num; i++) { Transform obj = Instantiate(things[(int)(things.Length * Random.value * .99999f)], transform.position + area.RandomInside(), Quaternion.identity) as Transform; obj.Rotate(orientation); obj.parent = transform; if (makePushable) { obj.gameObject.AddComponent <Pushable>(); } } if (randomness != RandomType.Normal) { RandomF.Pop(); } }