Esempio n. 1
0
    public void AddBonus(BonusModel model)
    {
        var bonus = GetBonus(model.bonusItem, model.bonusCharacteristic);

        if (bonus == null)
        {
            bonus = new AppliedBonus();
            bonus.AddTimeElapseListener(BonusTimeElapsed);
            appliedBonuses.Add(bonus);
        }

        bonus.Activate(model);

        Debug.Log("apply bonus " + bonus.model.bonusItem + " / " + bonus.model.bonusCharacteristic);

        switch (model.bonusItem)
        {
        case BonusModel.BonusItem.Stick:
            levelMan.GetStick().ApplyBonus(model);
            break;

        case BonusModel.BonusItem.Ball:
            levelMan.GetBall().ApplyBonus(model);
            break;

        case BonusModel.BonusItem.Match:
            // TODO
            break;
        }
    }