private void ApplyUpgrade(DamageMultiplierUpgrade upgrade) { DamageReceivedMultiplierModifier entityModifier = ScriptableObject.CreateInstance <DamageReceivedMultiplierModifier>(); entityModifier.Multiplier = upgrade.Multiplier; target.AddModifier(entityModifier); }
private void AddNewModifier() { List <DamageMultiplierUpgrade> allUpgrades = Upgrades.GetAllModifiers <DamageMultiplierUpgrade>(); if (allUpgrades.Count > 0) { DamageMultiplierUpgrade best = Upgrades.GetBestFloatValue(allUpgrades, x => x.Multiplier, comparer); ApplyUpgrade(best); } }