コード例 #1
0
    private void Start()
    {
        BonusDictionary = new BonusDictionary();

        CloseButton.onClick.AddListener(() =>
        {
            HidePanel();
        });

        ActiveIncomeBonusBuyButton.onClick.AddListener(() =>
        {
            GameController.StartActiveIncomeBonusCoroutine(BonusDictionary.GetBonusByKey(1));
            HidePanel();
        });

        PassiveIncomeBonusBuyButton.onClick.AddListener(() => {
            GameController.StartActiveIncomeBonusCoroutine(BonusDictionary.GetBonusByKey(2));
            HidePanel();
        });

        PassiveIncomeIntervalBonusBuyButton.onClick.AddListener(() => {
            GameController.StartActiveIncomeBonusCoroutine(BonusDictionary.GetBonusByKey(3));
            HidePanel();
        });

        SetBonusesDescriptions();
        SetBonusesPrices();
    }
コード例 #2
0
 public void IncreasePassiveIncome()
 {
     if (CanAffordPassiveIncomeUpgrade() && IsPassiveIncomeUpgradeAvailable())
     {
         UpgradesController.IncreasePassiveIncome(ref GetPassiveIncomeRef(), ref GetPreBonusPassiveIncomeRef());
         OverwriteValuesWithBonus(BonusDictionary.GetBonusByKey(2), ref GetPassiveIncomeRef(), ref GetPreBonusPassiveIncomeRef());
         DeductUpdateFee(UpgradesController.NextPassiveIncomeUpgradeCost);
         UpgradesController.SetNextPassiveIncomeUpgradeCost();
     }
 }
コード例 #3
0
 private void DefineInteractibleButtons()
 {
     ActiveIncomeBonusBuyButton.interactable          = GameController.CanBonusBeUsed(BonusDictionary.GetBonusByKey(1));
     PassiveIncomeBonusBuyButton.interactable         = GameController.CanBonusBeUsed(BonusDictionary.GetBonusByKey(2));
     PassiveIncomeIntervalBonusBuyButton.interactable = GameController.CanBonusBeUsed(BonusDictionary.GetBonusByKey(3));
 }