Ejemplo n.º 1
0
 public void RecordStatChange(AbilityPoints abilityPoints, AbilityStat abilityStat, float amount)
 {
     this.abilityPoints = abilityPoints;
     abilityChanges.Add(abilityStat);
     abilityChangeAmounts.Add(amount);
     abilityPoints.CurrentPoints--;
 }
Ejemplo n.º 2
0
        void AlterStat(AbilityStat abilityStat)
        {
            if (abilityPoints.CurrentPoints > 0)
            {
                float tempChangeAmount = 0;

                switch (abilityStat.statOperator)
                {
                case AbilityStat.StatOperator.Add:
                    tempChangeAmount = ABILITY_INCREMENT_AMOUNT;
                    break;

                case AbilityStat.StatOperator.Subtract:
                    tempChangeAmount = -ABILITY_INCREMENT_AMOUNT;
                    break;
                }
                statPoints.RecordStatChange(abilityPoints, abilityStat, tempChangeAmount);
                InvokeOnStatChanged(abilityStat, tempChangeAmount);
            }
        }
Ejemplo n.º 3
0
        void RegisterStatButtonEvent(GameObject button, AbilityStat stat)
        {
            Button statButton = button.GetComponent <Button>();

            statButton.onClick.AddListener(() => AlterStat(stat));
        }