示例#1
0
        public NetworkManager()
        {
            CommandHelper.Init();
            mTcpService = new TcpService();
            mTcpService.ConnectSucceedHandle = OnConnectSucceedHandle;
            mTcpService.ConnectFailedHandle  = OnConnectFailHandle;
            mTcpService.DisConnectedHandle   = OnDisConnectHandle;

            GameModuleManager.CreateModule <EventManager>();
            mEventManager = GameModuleManager.GetModule <IEventManager>();
        }
示例#2
0
        public void Destroy()
        {
            mIsInited    = false;
            mIsDestroyed = true;

            if (mGameObejct)
            {
                GameObject.Destroy(mGameObejct);
                mGameObejct = null;
                IResourcesManager tmpResMgr = GameModuleManager.GetModule <IResourcesManager>();
                tmpResMgr.UnLoadBundleByType(EABType.UI, BundleName);
            }
        }
示例#3
0
        internal async Task LoadWindowAsync()
        {
            IResourcesManager tmpResMgr = GameModuleManager.GetModule <IResourcesManager>();
            await tmpResMgr.LoadBundleByTypeAsync(EABType.UI, BundleName);

            if (mIsDestroyed)
            {
                tmpResMgr.UnLoadBundleByType(EABType.UI, BundleName);
                return;
            }

            InitWindow(tmpResMgr.GetAssetByType <GameObject>(EABType.UI, BundleName));

            if (mIsShowAfterLoaded)
            {
                Show();
            }
        }