Example #1
0
 /// <summary>Remove an effect of the list of active effects.</summary>
 /// <param name="effect">Effect to remove.</param>
 public void RemoveEffect(ICombatEffect effect)
 {
     if (activeEffects == null)
     {
         return;
     }
     // perhaps bug here: Maybe "Instantiate"d object != SO object
     if (activeEffects.Contains(effect))
     {
         activeEffects.Remove(effect);
     }
 }
Example #2
0
 /// <summary>Add a new effect to the list of active effects.</summary>
 /// <param name="effect">Effect to add.</param>
 public void AddEffect(ICombatEffect effect)
 {
     if (activeEffects == null)
     {
         return;
     }
     if (!activeEffects.Contains(effect))
     {
         activeEffects.Add(Instantiate(effect));
     }
     else
     {
         // perhaps bug here: Maybe "Instantiate"d object != SO object
         int index = activeEffects.IndexOf(effect);
         activeEffects[index].Refresh();
     }
 }