private void AddHandler(string eventID, CallbackEventDelegate raiseMethod, Delegate handler) { EventInfo info; if (_events.TryGetValue(eventID, out info)) { info.Handler = MulticastDelegate.Combine(info.Handler, handler); } else { _events[eventID] = new EventInfo(handler, raiseMethod); } }
public DurationCallbackEvent(float duration, CallbackEventDelegate callback) { this.callback = callback; this.duration = duration; }
public FrameCallbackEvent(float frame, CallbackEventDelegate callback) { this.callback = callback; this.frame = frame; }
public void AddCallbackAtDuration(float duration, CallbackEventDelegate callback) { Add(new DurationCallbackEvent(duration, callback)); }
public void AddCallbackAtFrame(float frame, CallbackEventDelegate callback) { Add(new FrameCallbackEvent(frame, callback)); }
public void AddCallbackAtEnd(CallbackEventDelegate callback) { Add(new FrameCallbackEvent(-1.0f /*last frame*/, callback)); }
public DelayCallbackEvent(float delay, CallbackEventDelegate callback) { this.callback = callback; this.delay = delay; }
public EventInfo(Delegate handler, CallbackEventDelegate raiseMethod) { Handler = handler; RaiseMethod = raiseMethod; }