コード例 #1
0
        public static Routine EventAsync <TEvent>(TEvent arg)
        {
#if UNITY_EDITOR
            if (!Application.isPlaying)
            {
                throw new PlatformNotSupportedException();
            }
#endif

            var handlers = EventManagerDispatcher <TEvent> .GetEventManager().GetEventHandlers();

            var runner = EventHandlerRunnerBuilder <TEvent> .Create(handlers, arg);

            return(EventScheduler.ExecuteAsync(runner));
        }
コード例 #2
0
        public static void Event <TEvent>(TEvent arg)
        {
#if UNITY_EDITOR
            if (!Application.isPlaying)
            {
                throw new PlatformNotSupportedException();
            }
#endif

            var handlers = EventManagerDispatcher <TEvent> .GetEventManager().GetEventHandlers();

            var runner = EventHandlerRunnerBuilder <TEvent> .Create(handlers, arg);

            EventScheduler.Schedule(runner);
        }