[NotNull] public IScope Enter(object state = null) { lock (mLock) { if (EnterTrigger == ScopeEnterTrigger.Entering) { mOnEnter?.Invoke(); } EnteringOverride(); Entering?.Invoke(this, new EventArgs()); mStateStack.Push(state); Entered?.Invoke(this, new EventArgs()); EnteredOverride(); if (EnterTrigger == ScopeEnterTrigger.Entered) { mOnEnter?.Invoke(); } } return(this); }
/// <summary> /// Called as the object goes from Inactive to Active. Prefer <see cref="Entering"/> if you /// are programmatically adding event handlers at runtime. If you are adding event handlers /// in the Unity Editor, prefer <see cref="onEntering"/>. If you are waiting for this event /// in a subclass of StateController, prefer overriding the <see cref="OnEnable"/> method. /// </summary> protected virtual void OnEntering() { if (!skipEvents) { if (onEntering != null) { onEntering?.Invoke(); } Entering?.Invoke(this, EventArgs.Empty); } }
internal virtual void OnEntering(IRpcSession session) { if (session == null) { throw new ArgumentNullException(nameof(session)); } if (Collection.Contains(session)) { return; } Entering?.Invoke(this, new EventArgs <IRpcSession>(session)); Collection.Add(session); }
public virtual void OnEntering(EndPoint endPoint) { Entering?.Invoke(this, new EventArgs <EndPoint>(endPoint)); }