Im currently making a game where I want to spawn a lot of different enemies. Currently I have a lot Data containers for units I create through ScriptableObjects. These units contain different sorts of data such as HP, loot, damage etc. I've thought of adding another type of data which is going to be their individual % to spawn or something similar but I am kind off stuck not knowing how to implement something like that. 

Here is my current code where I spawn enemies completely randomize from two different lists of either Melee or Ranged enemies.

```
IEnumerator SpawnEnemies()
    {
        //Spawn enemies while amount of enemies are under predetermined enemy amount.
        while (spawnedEnemies < totalEnemiesInCurrentWave)
        {
            //Randomize if Melee or Ranged enemy.
            whichEnemyType = Random.Range(0, 2);
            GameObject enemy = waves[currentWave].enemyPrefab[whichEnemyType];

            spawnedEnemies++;
            enemiesInWaveLeft++;

            //Can I get a probability % to spawn each enemy? Currently completely random.
            switch (whichEnemyType)
            {
                case 0:
                    GameObject Melee = Instantiate(enemy, spawnPoint.position, Quaternion.identity);
                    Melee.GetComponent<Melee>().unit = meleeUnits[Random.Range(0, meleeUnits.Count)];
                    break;
                case 1:
                    GameObject Ranged = Instantiate(enemy, spawnPoint.position, Quaternion.identity);
                    Ranged.GetComponent<Ranged>().unit = rangedUnits[Random.Range(0, rangedUnits.Count)];
                    break;
                default:
                    break;
            }
            yield return new WaitForSeconds(timeBetweenEnemies);
        }
        yield return null;

    }

```

Can someone point me to a better way to handle randomizing enemies or if possible, give me some sort of idea in how to do this.

Thank you.