예제 #1
0
 /// <summary>
 /// Removes a linker from the stat and stops listening to the value change event
 /// </summary>
 /// <param name="linker"></param>
 public void RemoveLinker(RPGStatLinker linker)
 {
     if (linker != null)
     {
         _statLinkers.Remove(linker);
         if (linker.LinkedStat != null)
         {
             linker.LinkedStat.RemoveValueListener(OnLinkedStatValueChange);
         }
     }
 }
예제 #2
0
 /// <summary>
 /// Add a linker to the stat and listen to it's valueChange event
 /// </summary>
 public void AddLinker(RPGStatLinker linker)
 {
     if (linker != null)
     {
         _statLinkers.Add(linker);
         if (linker.LinkedStat != null)
         {
             linker.LinkedStat.AddValueListener(OnLinkedStatValueChange);
         }
     }
 }
 /// <summary>
 /// Removes the linker.
 /// </summary>
 /// <param name="linker">Linker.</param>
 public void RemoveLinker(RPGStatLinker linker)
 {
     _statLinkers.Remove(linker);
     linker.OnValueChange -= OnLinkerValueChange;
 }
 /// <summary>
 /// Adds the linker.
 /// </summary>
 /// <param name="linker">Linker.</param>
 public void AddLinker(RPGStatLinker linker)
 {
     _statLinkers.Add(linker);
     linker.OnValueChange += OnLinkerValueChange;
 }