コード例 #1
0
 /// <summary>
 /// Add a unique listener to the signal.
 /// </summary>
 public void AddListener(SignalDelegate listener)
 {
     if (SendSignal != null && SendSignal.GetInvocationList().Contains(listener))
     {
         Debug.LogWarning(string.Format("Signal already has registered the listener {0}", listener.Method.Name));
     }
     SendSignal += listener;
 }
コード例 #2
0
ファイル: Signal.cs プロジェクト: johans2/Runner
 /// <summary>
 /// Add a unique listener to the signal.
 /// </summary>
 public void AddListener(SignalDelegate listener)
 {
     if (SendSignal == null)
     {
         SendSignal += listener;
     }
     else if (!SendSignal.GetInvocationList().Contains(listener))
     {
         SendSignal += listener;
     }
 }