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); }
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(); }
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(); }
public static bool QueueOrExecute(IInterpTimedEventReceiver receiver, bool immediate, string tag, ref uLink.NetworkMessageInfo info) { return(QueueOrExecute(receiver, immediate, tag, ref info, emptyArgs)); }
public static bool Queue(IInterpTimedEventReceiver receiver, string tag, ref uLink.NetworkMessageInfo info, params object[] args) { return(QueueOrExecute(receiver, false, tag, ref info, args)); }
public static bool Queue(IInterpTimedEventReceiver receiver, string tag, ref uLink.NetworkMessageInfo info) { return(InterpTimedEvent.QueueOrExecute(receiver, false, tag, ref info, InterpTimedEvent.emptyArgs)); }
public static bool Execute(IInterpTimedEventReceiver receiver, string tag, ref NetworkMessageInfo info) { return(QueueOrExecute(receiver, true, tag, ref info, emptyArgs)); }