コード例 #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);
         }
     }
 }