private void OnIntervalCompleted(IntervalReachedEventArgs arguments) { IntervalEventHandler handler = IntervalCompleted; if (handler != null) { handler(this, arguments); } }
// 主线程循环 internal static void MainThreadUpdate() { FocusEventHandler.MainThreadUpdate(); ScreenResizeEventHandler.MainThreadUpdate(); CollisionEventHandler.MainThreadUpdate(); TriggerEventHandler.MainThreadUpdate(); PointerEventHandlerForScreen.MainThreadUpdate(); PointerEventHandlerForUI.MainThreadUpdate(); PointerEventHandlerForMesh.MainThreadUpdate(); KeyboardEventHandler.MainThreadUpdate(); FrameLoopEventHandler.MainThreadUpdate(); IntervalEventHandler.MainThreadUpdate(); CustomEventHandler.MainThreadUpdate(); TraceEventHandler.MainThreadUpdate(); }
/// <summary> 移除时间间隔事件侦听 </summary> /// <param name="listener">时间间隔事件侦听函数</param> public void RemoveIntervalListener(Action listener) => IntervalEventHandler.RemoveListener(listener);
/// <summary> 添加时间间隔事件侦听</summary> /// <param name="listener">时间间隔事件侦听函数</param> /// <param name="interval">设置触发间隔 ( 单位:秒 ) </param> /// <param name="times">设置事件可触发的总次数,默认为 0 时为不限次数</param> public void AddIntervalListener(Action listener, double interval, int times = 0) => IntervalEventHandler.AddListener(listener, interval, times);