Exemple #1
0
    public virtual EventConnection Connect(int priority, LocalEventHandler handler)
    {
        var connection = new EventConnection(this, handler, priority);

        subscriptions.Add(connection);
        subscriptions.Sort((a, b) => a.Priority - b.Priority);
        return(connection);
    }
Exemple #2
0
 public EventConnection(LocalEvent <T> evt, LocalEventHandler handler, int priority)
 {
     Event    = evt;
     Handler  = handler;
     Priority = priority;
 }
Exemple #3
0
 public virtual EventConnection Connect(LocalEventHandler handler)
 {
     return(Connect(0, handler));
 }
Exemple #4
0
 public void SetTarget(GameObject ob)
 {
     eventHandler = ob.GetComponent <LocalEventHandler>();
 }