// Use this for initialization void Start() { int currentfishcounter = 0; while (currentfishcounter < fishCount) { Vector3 fishPosition = Random.insideUnitSphere * 100f; fishscript newFish = Instantiate(fishBlueprint, fishPosition, Quaternion.identity) as fishscript; fishlist.Add(newFish); currentfishcounter++; } }
// Use this for initialization void Start() { int currentfishcounter = 0; while (currentfishcounter < fishCount) { randomNum = Random.Range(0, 100); if (randomNum < 50) { Vector3 fishPosition = Random.insideUnitSphere * 20f; fishscript newFish = Instantiate(fishBlueprint, fishPosition, Quaternion.identity) as fishscript; fishlist.Add(newFish); currentfishcounter++; } else { Vector3 fishPosition = Random.insideUnitSphere * 20f; fishscript newFish = Instantiate(fishBlueprint2, fishPosition, Quaternion.identity) as fishscript; fishlist.Add(newFish); currentfishcounter++; } } }