public void ChangeModifier(int newModId) { RemoveModifier(); currentModifier = WeaponModDictionary.instance.GetWeaponModifier(newModId); currentModifier?.Apply(this); ModifierChosen = true; }
void ChooseModifier() { if (!ModifierChosen) { if (ModId < 0) { ModId = Random.Range(0, WeaponModDictionary.instance.WeaponModifiers.Length); Debug.LogFormat("Randomly chosen ModifierId for {0} was {1}", name, ModId); } currentModifier = WeaponModDictionary.instance.GetWeaponModifier(ModId); currentModifier?.Apply(this); ModifierChosen = true; } }