Exemplo n.º 1
0
    private void SpawnBonus(Vector2 position)
    {
        int roll = Random.Range(0, 100);

        if (roll >= 20)
        {
            return;
        }

        Array  categories = Enum.GetValues(typeof(BonusCategory));
        IBonus bonus      = _bonusPool.TakeBonus((BonusCategory)UnityEngine.Random.Range(0, categories.Length));

        bonus.Reset(position);
    }