Example #1
0
        private void ApplyUpgrade(DamageMultiplierUpgrade upgrade)
        {
            DamageReceivedMultiplierModifier entityModifier = ScriptableObject.CreateInstance <DamageReceivedMultiplierModifier>();

            entityModifier.Multiplier = upgrade.Multiplier;

            target.AddModifier(entityModifier);
        }
Example #2
0
        private void AddNewModifier()
        {
            List <DamageMultiplierUpgrade> allUpgrades = Upgrades.GetAllModifiers <DamageMultiplierUpgrade>();

            if (allUpgrades.Count > 0)
            {
                DamageMultiplierUpgrade best = Upgrades.GetBestFloatValue(allUpgrades, x => x.Multiplier, comparer);
                ApplyUpgrade(best);
            }
        }