internal static UnityEventSource Request(UnityEvent unityEvent) { UnityEventSource source = null; if (_pool.Count == 0) { source = new UnityEventSource(); } else { source = _pool.Pop(); } source.Initialize(unityEvent); return(source); }
public static SourceAwaiter GetAwaiter(this UnityEvent evt) { return(new SourceAwaiter(UnityEventSource.Request(evt))); }
public static SourceAwaiter <T> GetAwaiter <T>(this UnityEvent <T> evt) { var source = UnityEventSource <T> .Request(evt); return(new SourceAwaiter <T>(source)); }