Ejemplo n.º 1
0
    public void DrawNewWeapon()
    {
        float  randomFloat   = Random.Range(0f, 1f);
        Weapon currentWeapon = GameData.GetWeapon(1);

        foreach (var weapon in GameData.Weapons)
        {
            if (randomFloat <= weapon.ChanceOfBeingPicked && weapon.NbColorAffected < Tower.NbColorInTower)
            {
                currentWeapon = weapon;
                break;
            }
        }

        CurrentWeaponColors = Tower.GetRandomColorsAvailableInTower(currentWeapon.NbColorAffected);
        ComboCount          = 0;
        EventManager.TriggerEvent(EventList.OnDrawNewBall);
    }