Example #1
0
        protected virtual void OnEvent(Event e)
        {
            Profiler.BeginScope($"{nameof(OnEvent)}({ e.GetType().Name})");
            var layers = LayerStack.GetLayers();

            for (int i = layers.Count - 1; i >= 0; i--)
            {
                if (e.Handled)
                {
                    break;
                }
                layers[i].OnEvent(e);
            }

            if (!e.Handled)
            {
                Input.OnEvent(e);
            }
            if (!e.Handled)
            {
                GlobalEventDispatcher.Dispatch(e);
            }

            Profiler.EndScope();
        }
Example #2
0
        public SceneService(CoroutineService coroutineService, GlobalEventDispatcher globalEventDispatcher)
        {
            this.coroutineService      = coroutineService;
            this.globalEventDispatcher = globalEventDispatcher;

            SceneManager.sceneLoaded += OnSceneLoaded;
        }