Пример #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);
        }
Пример #2
0
 public static SourceAwaiter GetAwaiter(this UnityEvent evt)
 {
     return(new SourceAwaiter(UnityEventSource.Request(evt)));
 }
Пример #3
0
        public static SourceAwaiter <T> GetAwaiter <T>(this UnityEvent <T> evt)
        {
            var source = UnityEventSource <T> .Request(evt);

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