예제 #1
0
        private void Initialize()
        {
            /**
             * Please don't remove this line
             * This is the only eDriven.Gui line I'd like to have written in Your app log :)
             * It's interesting to see if application uses the framework
             * */
            if (Framework.EnableInfoMessages)
            {
                Debug.Log(string.Format(@"eDriven.Gui framework: instantiated: {0}", new Info()));
            }

#if DEBUG
            Debug.Log(string.Format(@"***** Debug build *****"));
#endif

#if TRIAL
            Debug.Log(string.Format(@"***** eDriven.Gui Free Edition *****"));
#endif

#if !RELEASE
            Debug.Log(string.Format(@"***** Not a realese build *****"));
#endif

            /**
             * 1) Connect to system manager clocks
             * */
            //SystemManager.Instance.UpdateSignal.Connect(_updateSlot, 0, false);

            //Debug.Log("*** SUBSCRIBING ***");
            SystemManager.Instance.RenderSignal.Connect(RenderSlot);
            SystemManager.Instance.ResizeSignal.Connect(ResizeSlot);
            SystemManager.Instance.SceneChangeSignal.Connect(SceneChangeSlot);
            //SystemManager.Instance.LevelInitSignal.Connect(LevelInitSlot);
            //SystemManager.Instance.LevelLoadedSignal.Connect(LevelInitSlot);
            //SystemManager.Instance.LevelLoadedSignal.Connect(LevelInitSlot);
            SystemManager.Instance.DisposingSignal.Connect(DisposingSlot, true); // auto disconnect

            /**
             * 3) let interested parties reference the stage list
             * */

            DragDropManager.StageList = _stageListDesc;

            CoordinateProcessor.StageListAsc  = _stageListAsc;
            CoordinateProcessor.StageListDesc = _stageListDesc;

            // initialize styles
            //StyleInitializer.Run();

#pragma warning disable 168
            //var med = MouseEventDispatcher.Instance;

// ReSharper disable UnusedVariable
            var fm = FocusManager.Instance;   // initialize listeners to mouse event manager
            var tm = TooltipManager.Instance; // initialize listeners to mouse event manager
            var km = KeyEventDispatcher.Instance;

            NamingUtil.Initialize();
            var cm = ComponentManager.Instance;
// ReSharper restore UnusedVariable

            /* Important! */
            // ReSharper disable once UnusedVariable
            var mq = MediaQueryManager.Instance;

// ReSharper disable once UnusedVariable
            var scm = StyleClientManager.Instance;

#pragma warning restore 168

#if DEBUG
            if (DebugMode)
            {
                Debug.Log(string.Format("StageManager instantiated [width: {0}; height:{1}]", _size.X, _size.Y));
            }
#endif

#if TRIAL
            // check piracy
            //GenuineChecker.Check();
#endif

#if TRIAL
            _acme      = (Acme)Framework.GetComponent <Acme>(true);
            _lockStyle = LockButtonStyle.Instance;
            //if (!Application.isEditor) {
            _startTime = Time.time;
            System.Random random = new System.Random();
            _timeToWait = random.Next(10, 1200);     // 10s - / 1200 = 20 min
            if (Application.isEditor)
            {
                _timeToWait += 300;     // 5 minutes
            }
            //}
#endif
        }