Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 public static SourceAwaiter GetAwaiter(this UnityEvent evt)
 {
     return(new SourceAwaiter(UnityEventSource.Request(evt)));
 }
Ejemplo n.º 3
0
        public static SourceAwaiter <T> GetAwaiter <T>(this UnityEvent <T> evt)
        {
            var source = UnityEventSource <T> .Request(evt);

            return(new SourceAwaiter <T>(source));
        }