Exemplo n.º 1
0
 public void ChangeModifier(int newModId)
 {
     RemoveModifier();
     currentModifier = WeaponModDictionary.instance.GetWeaponModifier(newModId);
     currentModifier?.Apply(this);
     ModifierChosen = true;
 }
Exemplo n.º 2
0
 public void RemoveModifier()
 {
     if (currentModifier)
     {
         currentModifier.Remove(this);
         currentModifier = null;
     }
 }
Exemplo n.º 3
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;
        }
    }