private float chance;
private float spawnpointChance;
//массив с точками спавна, в инспекторе настроишь
private Vector3[] spawnpoints;
//в том же инспекторе закинь сюда белое и чёрное яйцо соответственно
[SerializeField] private GameObject whiteEgg;
[SerializeField] private GameObject blackEgg;
private void Update () {
chance = Random.Range(0, 100);
if(chance <= 75) {
Instantiate(whiteEgg);
spawnpointChance = Random.Range(0, 7);
whiteEgg.transform.position = spawnpoints[spawnpointChance];
else if (chance > 75) {
Instantiate(blackEgg);
spawnpointChance = Random.Range(0, 7);
blackEgg.transform.position = spawnpoints[spawnpointChance];
}
}
}