Beispiel #1
0
 public void RaiseEvent(bool value)
 {
     if (OnEventRaised != null)
     {
         OnEventRaised.Invoke(value);
     }
 }
Beispiel #2
0
 public void UnsubscribeAll()
 {
     if (OnEventRaised != null)
     {
         if (OnEventRaised.GetInvocationList() != null)
         {
             foreach (System.Delegate d in OnEventRaised.GetInvocationList())
             {
                 OnEventRaised -= d as UnityAction <bool>;
             }
         }
     }
 }
Beispiel #3
0
 public void RaisedEvent(PipelineEvent pEvent)
 {
     if (OnEventRaised == null)
     {
         return;
     }
     Parallel.ForEach(OnEventRaised.GetInvocationList(), t => {
         ((EventHandler <PipelineEventEventArgs>)t).BeginInvoke(
             this, new PipelineEventEventArgs()
         {
             Event = pEvent
         }, null, null);
     });
 }
Beispiel #4
0
    public void Raise()
    {
        if (debug)
        {
            Debug.Log(string.Format("GameEvent Raised ({0}), no data passed.", name), this);
        }

        try
        {
            OnEventRaised?.Invoke();
        }
        catch (Exception e)
        {
            Debug.LogException(e);
        }
    }
Beispiel #5
0
    public void Raise(object caller, object data = null)
    {
        if (debug)
        {
            Debug.Log(string.Format("GameEvent Raised ({0}), caller: {1}, data: {2}", name, caller, data), this);
        }

        try
        {
            OnEventRaised?.Invoke();
            OnEventDataRaised?.Invoke(new GameEventData(this, data, caller));
        }
        catch (Exception e)
        {
            Debug.LogException(e);
        }
    }
Beispiel #6
0
 public Delegate[] GetOnEventRaisedInvocationsList()
 {
     return(OnEventRaised?.GetInvocationList());
 }
Beispiel #7
0
 public void RaiseEvent(T data)
 {
     value = data;
     OnEventRaised?.Invoke(data);
 }