Пример #1
0
    public static bool QueueOrExecute(IInterpTimedEventReceiver receiver, bool immediate, string tag, ref uLink.NetworkMessageInfo info, params object[] args)
    {
        UnityEngine.MonoBehaviour behaviour = receiver as UnityEngine.MonoBehaviour;
        InterpTimedEvent          evnt      = New(behaviour, tag, ref info, args, immediate);

        if (evnt == null)
        {
            return(false);
        }
        if (immediate)
        {
            InvokeDirect(evnt);
        }
        else if (!InterpTimedEventSyncronizer.available)
        {
            Debug.LogWarning("Not running event because theres no syncronizer available. " + tag, receiver as UnityEngine.Object);
            return(false);
        }
        return(true);
    }
Пример #2
0
 private static void Invoke()
 {
     UnityEngine.MonoBehaviour component = current.component;
     if (component != null)
     {
         IInterpTimedEventReceiver receiver = component as IInterpTimedEventReceiver;
         try
         {
             receiver.OnInterpTimedEvent();
         }
         catch (Exception exception)
         {
             Debug.LogError("Exception thrown during catchup \r\n" + exception, component);
         }
     }
     else
     {
         Debug.LogWarning("A component implementing IInterpTimeEventReceiver was destroyed without properly calling InterpEvent.Remove() in OnDestroy!\r\n" + (!string.IsNullOrEmpty(current.tag) ? ("The tag was \"" + current.tag + "\"") : "There was no tag set"));
     }
     current.Dispose();
 }
Пример #3
0
 private static void Invoke()
 {
     UnityEngine.MonoBehaviour monoBehaviour = InterpTimedEvent.current.component;
     if (!monoBehaviour)
     {
         Debug.LogWarning(string.Concat("A component implementing IInterpTimeEventReceiver was destroyed without properly calling InterpEvent.Remove() in OnDestroy!\r\n", (!string.IsNullOrEmpty(InterpTimedEvent.current.tag) ? string.Concat("The tag was \"", InterpTimedEvent.current.tag, "\"") : "There was no tag set")));
     }
     else
     {
         IInterpTimedEventReceiver interpTimedEventReceiver = monoBehaviour as IInterpTimedEventReceiver;
         try
         {
             interpTimedEventReceiver.OnInterpTimedEvent();
         }
         catch (Exception exception)
         {
             Debug.LogError(string.Concat("Exception thrown during catchup \r\n", exception), monoBehaviour);
         }
     }
     InterpTimedEvent.current.Dispose();
 }
Пример #4
0
 public static bool QueueOrExecute(IInterpTimedEventReceiver receiver, bool immediate, string tag, ref uLink.NetworkMessageInfo info)
 {
     return(QueueOrExecute(receiver, immediate, tag, ref info, emptyArgs));
 }
Пример #5
0
 public static bool Queue(IInterpTimedEventReceiver receiver, string tag, ref uLink.NetworkMessageInfo info, params object[] args)
 {
     return(QueueOrExecute(receiver, false, tag, ref info, args));
 }
Пример #6
0
 public static bool Queue(IInterpTimedEventReceiver receiver, string tag, ref uLink.NetworkMessageInfo info)
 {
     return(InterpTimedEvent.QueueOrExecute(receiver, false, tag, ref info, InterpTimedEvent.emptyArgs));
 }
Пример #7
0
 public static bool Execute(IInterpTimedEventReceiver receiver, string tag, ref NetworkMessageInfo info)
 {
     return(QueueOrExecute(receiver, true, tag, ref info, emptyArgs));
 }