Example #1
0
        /// <summary>
        /// Initialization routine
        /// </summary>
        private void Initialize()
        {
            #if DEBUG
            if (DebugMode)
                Debug.Log(string.Format("Initializing system manager"));
            #endif
            /**
             * 1.a) Instantiate signals
             * */
            FixedUpdateSignal = new Signal();
            UpdateSignal = new Signal();
            LateUpdateSignal = new Signal();
            ResizeSignal = new Signal();
            DisposingSignal = new Signal();
            LevelInitSignal = new Signal();
            LevelLoadedSignal = new Signal();
            SceneChangeSignal = new Signal();
            GizmoSignal = new Signal();
            TouchSignal = new Signal();

            /**
             * 1.b) Instantiate signals requiring OnGUI processing
             * */

            PreRenderSignal = new StateHandlingSignal(SignalStateChangedHandler);
            RenderSignal = new StateHandlingSignal(SignalStateChangedHandler);

            MouseDownSignal = new StateHandlingSignal(SignalStateChangedHandler);
            MouseUpSignal = new StateHandlingSignal(SignalStateChangedHandler);

            MiddleMouseDownSignal = new StateHandlingSignal(SignalStateChangedHandler);
            MiddleMouseUpSignal = new StateHandlingSignal(SignalStateChangedHandler);

            RightMouseDownSignal = new StateHandlingSignal(SignalStateChangedHandler);
            RightMouseUpSignal = new StateHandlingSignal(SignalStateChangedHandler);

            MouseMoveSignal = new StateHandlingSignal(SignalStateChangedHandler);
            MouseDragSignal = new StateHandlingSignal(SignalStateChangedHandler);
            MouseWheelSignal = new StateHandlingSignal(SignalStateChangedHandler);

            KeyDownSignal = new StateHandlingSignal(SignalStateChangedHandler);
            KeyUpSignal = new StateHandlingSignal(SignalStateChangedHandler);

            /**
             * 2) Instantiate processors
             * */
            _keyboardProcessor = new KeyboardProcessor(this);
            _mouseProcessor = new MouseProcessor(this);
            _mousePositionProcessor = new MousePositionProcessor(this);
            _touchProcessor = new TouchProcessor(this);
            _screenSizeProcessor = new ScreenSizeProcessor(this);

            /**
             * 3.a) Instantiate SystemManagerInvoker
             * */
            Framework.CreateComponent<SystemManagerInvoker>(true); // exclusive, i.e. allow single instance only

            /**
             * 3.b) Instantiate SystemManagerOnGuiInvoker
             * Keeping reference to it so we could disable it when OnGUI processing not needed
             * */
            _onGuiInvoker = (SystemManagerOnGuiInvoker)Framework.CreateComponent<SystemManagerOnGuiInvoker>(true); // exclusive, i.e. allow single instance only
            _onGuiInvoker.enabled = false; // disable it by default
        }
Example #2
0
        /// <summary>
        /// Initialization routine
        /// </summary>
        private void Initialize()
        {
#if DEBUG
            if (DebugMode)
            {
                Debug.Log(string.Format("Initializing system manager"));
            }
#endif

            /**
             * 1.a) Instantiate signals
             * */
            FixedUpdateSignal = new Signal();
            UpdateSignal      = new Signal();
            LateUpdateSignal  = new Signal();
            ResizeSignal      = new Signal();
            DisposingSignal   = new Signal();
            LevelInitSignal   = new Signal();
            LevelLoadedSignal = new Signal();
            SceneChangeSignal = new Signal();
            GizmoSignal       = new Signal();
            TouchSignal       = new Signal();

            /**
             * 1.b) Instantiate signals requiring OnGUI processing
             * */

            PreRenderSignal = new StateHandlingSignal(SignalStateChangedHandler);
            RenderSignal    = new StateHandlingSignal(SignalStateChangedHandler);

            MouseDownSignal = new StateHandlingSignal(SignalStateChangedHandler);
            MouseUpSignal   = new StateHandlingSignal(SignalStateChangedHandler);

            MiddleMouseDownSignal = new StateHandlingSignal(SignalStateChangedHandler);
            MiddleMouseUpSignal   = new StateHandlingSignal(SignalStateChangedHandler);

            RightMouseDownSignal = new StateHandlingSignal(SignalStateChangedHandler);
            RightMouseUpSignal   = new StateHandlingSignal(SignalStateChangedHandler);

            MouseMoveSignal  = new StateHandlingSignal(SignalStateChangedHandler);
            MouseDragSignal  = new StateHandlingSignal(SignalStateChangedHandler);
            MouseWheelSignal = new StateHandlingSignal(SignalStateChangedHandler);

            KeyDownSignal = new StateHandlingSignal(SignalStateChangedHandler);
            KeyUpSignal   = new StateHandlingSignal(SignalStateChangedHandler);

            /**
             * 2) Instantiate processors
             * */
            _keyboardProcessor      = new KeyboardProcessor(this);
            _mouseProcessor         = new MouseProcessor(this);
            _mousePositionProcessor = new MousePositionProcessor(this);
            _touchProcessor         = new TouchProcessor(this);
            _screenSizeProcessor    = new ScreenSizeProcessor(this);

            /**
             * 3.a) Instantiate SystemManagerInvoker
             * */
            Framework.CreateComponent <SystemManagerInvoker>(true); // exclusive, i.e. allow single instance only

            /**
             * 3.b) Instantiate SystemManagerOnGuiInvoker
             * Keeping reference to it so we could disable it when OnGUI processing not needed
             * */
            _onGuiInvoker         = (SystemManagerOnGuiInvoker)Framework.CreateComponent <SystemManagerOnGuiInvoker>(true); // exclusive, i.e. allow single instance only
            _onGuiInvoker.enabled = false;                                                                                  // disable it by default
        }
Example #3
0
        /// <summary>
        /// Initialization routine
        /// </summary>
        private void Initialize()
        {
            #if DEBUG
            if (DebugMode)
                Debug.Log(string.Format("Initializing system manager"));
            #endif

            /**
             * 1) Instantiate SystemManagerInvoker
             * */
            Framework.CreateComponent(typeof(SystemManagerInvoker), true); // exclusive, i.e. allow single instance only

            /**
             * 2) Instantiate signals
             * */
            FixedUpdateSignal = new Signal();
            UpdateSignal = new Signal();
            LateUpdateSignal = new Signal();
            PreRenderSignal = new Signal();
            RenderSignal = new Signal();
            ResizeSignal = new Signal();
            DisposingSignal = new Signal();
            LevelLoadedSignal = new Signal();
            SceneChangeSignal = new Signal();

            MouseDownSignal = new Signal();
            MouseUpSignal = new Signal();

            MiddleMouseDownSignal = new Signal();
            MiddleMouseUpSignal = new Signal();

            RightMouseDownSignal = new Signal();
            RightMouseUpSignal = new Signal();

            MouseMoveSignal = new Signal();
            MouseDragSignal = new Signal();
            MouseWheelSignal = new Signal();

            KeyDownSignal = new Signal();
            KeyUpSignal = new Signal();

            TouchSignal = new Signal();

            /**
             * 3) Instantiate processors
             * */
            _keyboardProcessor = new KeyboardProcessor(this);
            _mouseProcessor = new MouseProcessor(this);
            _mousePositionProcessor = new MousePositionProcessor(this);
            _touchProcessor = new TouchProcessor(this);
            _screenSizeProcessor = new ScreenSizeProcessor(this);
        }