Exemplo n.º 1
0
 protected override void Awake()
 {
     base.Awake();
     m_IEventPoolManager = GameBox.App.Driver.GetModule <IEventPoolManager>();
     if (null == m_IEventPoolManager)
     {
         throw new GameBoxFrameworkException("IEventPoolManager是无效的!");
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// 初始化组件
        /// </summary>
        protected override void Awake()
        {
            base.Awake();

            m_IEventPoolManager = GameBox.App.Driver.GetModule <IEventPoolManager>();
            if (null == m_IEventPoolManager)
            {
                throw new GameBoxFrameworkException("IEventPoolManager是无效的.");
            }

            if (null == m_IHttpClient && null == GetComponent <IHttpClient>())
            {
                m_IHttpClient = gameObject.AddComponent <HttpMonoClient>();
            }

            RegisterHttpEventTopic(); //注册Http事件主题
        }
Exemplo n.º 3
0
        protected override void Awake()
        {
            base.Awake();

            m_INetworkManager = GameBox.App.Driver.GetModule <INetworkManager>();
            if (null == m_INetworkManager)
            {
                throw new GameBoxFrameworkException("INetworkManager是无效的!");
            }

            m_IEventPoolManager = GameBox.App.Driver.GetModule <IEventPoolManager>();
            if (null == m_IEventPoolManager)
            {
                throw new GameBoxFrameworkException("IEventPoolManager是无效的!");
            }


            RegisterNetworkEventTopic(); //注册网络主题事件

            m_INetworkManager.NetworkEventHandler += M_INetworkManager_NetworkEventHandler;
        }
Exemplo n.º 4
0
        protected override void Awake()
        {
            base.Awake();

            m_IEventPoolManager = GameBox.App.Driver.GetModule <IEventPoolManager>();
            if (null == m_IEventPoolManager)
            {
                throw new GameBoxFrameworkException("IEventPoolManager是无效的.");
            }

            if (null == m_SceneManager && null == gameObject.GetComponent <SceneManager>())
            {
                m_SceneManager = gameObject.AddComponent <SceneManager>();

                m_SceneManager.LoadFailureEventHandler += (o, e) => { if (null != LoadFailureEventHandler)
                                                                      {
                                                                          LoadFailureEventHandler(this, e);
                                                                      }
                };
                m_SceneManager.LoadSuccessEventHandler += (o, e) => { if (null != LoadSuccessEventHandler)
                                                                      {
                                                                          LoadSuccessEventHandler(this, e);
                                                                      }
                };
                m_SceneManager.LoadUpdateEventHandler += (o, e) => { if (null != LoadUpdateEventHandler)
                                                                     {
                                                                         LoadUpdateEventHandler(this, e);
                                                                     }
                };

                m_SceneManager.UnLoadFailureEventHandler += (o, e) => { if (null != UnLoadFailureEventHandler)
                                                                        {
                                                                            UnLoadFailureEventHandler(this, e);
                                                                        }
                };
                m_SceneManager.UnLoadSuccessEventHandler += (o, e) => { if (null != UnLoadSuccessEventHandler)
                                                                        {
                                                                            UnLoadSuccessEventHandler(this, e);
                                                                        }
                };
                m_SceneManager.UnLoadUpdateEventHandler += (o, e) => { if (null != UnLoadUpdateEventHandler)
                                                                       {
                                                                           UnLoadUpdateEventHandler(this, e);
                                                                       }
                };

                m_SceneManager.MoveToSuccessEventHandler += (o, e) => { if (null != MoveToSuccessEventHandler)
                                                                        {
                                                                            MoveToSuccessEventHandler(this, e);
                                                                        }
                };
                m_SceneManager.MoveToFailureEventHandler += (o, e) => { if (null != MoveToFailureEventHandler)
                                                                        {
                                                                            MoveToFailureEventHandler(this, e);
                                                                        }
                };
                m_SceneManager.MoveToUpdateEventHandler += (o, e) => { if (null != MoveToUpdateEventHandler)
                                                                       {
                                                                           MoveToUpdateEventHandler(this, e);
                                                                       }
                };

                RegisterSceneEventTopic();
            }
        }