예제 #1
0
 public void ChangeModifier(int newModId)
 {
     RemoveModifier();
     currentModifier = WeaponModDictionary.instance.GetWeaponModifier(newModId);
     currentModifier?.Apply(this);
     ModifierChosen = true;
 }
예제 #2
0
    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;
        }
    }