Пример #1
0
        public void onLoadEventHandle(IDispatchObject dispObj)
        {
            ResItem res = dispObj as ResItem;

            if (res.refCountResLoadResultNotify.resLoadState.hasSuccessLoaded())
            {
                Ctx.m_instance.m_logSys.debugLog_1(LangItemID.eItem0, res.GetPath());

                if (m_path2SoundDic.ContainsKey(res.GetPath()))      // 如果有,说明还没被停止
                {
                    if (m_path2SoundDic[res.GetPath()].m_soundResType == SoundResType.eSRT_Prefab)
                    {
                        m_path2SoundDic[res.GetPath()].setResObj(res.InstantiateObject(res.GetPath()));
                    }
                    else
                    {
                        m_path2SoundDic[res.GetPath()].setResObj(res.getObject(res.GetPath()));
                    }
                }
                // 播放音乐
                play(res.GetPath());
            }
            else if (res.refCountResLoadResultNotify.resLoadState.hasFailed())
            {
                Ctx.m_instance.m_logSys.debugLog_1(LangItemID.eItem0, res.GetPath());
                delSoundItem(m_path2SoundDic[res.GetPath()]);
            }
            // 卸载数据
            Ctx.m_instance.m_resLoadMgr.unload(res.GetPath(), onLoadEventHandle);
        }
Пример #2
0
        public void onGameLoadEventHandle(IDispatchObject dispObj)
        {
            ResItem res = dispObj as ResItem;

            if (res.refCountResLoadResultNotify.resLoadState.hasSuccessLoaded())
            {
                Ctx.m_instance.m_layerMgr.m_path2Go[ModulePath.GAMEMN]      = res.InstantiateObject(m_type2ItemDic[ModuleID.GAMEMN].m_path);
                Ctx.m_instance.m_layerMgr.m_path2Go[ModulePath.GAMEMN].name = ModuleName.GAMEMN;
                Ctx.m_instance.m_layerMgr.m_path2Go[NotDestroyPath.ND_CV_Game].transform.parent = Ctx.m_instance.m_layerMgr.m_path2Go[NotDestroyPath.ND_CV_Root].transform;

                // 游戏模块也不释放
                UtilApi.DontDestroyOnLoad(Ctx.m_instance.m_layerMgr.m_path2Go[NotDestroyPath.ND_CV_Game]);

                // 立马卸载这个资源
                Ctx.m_instance.m_resLoadMgr.unload(m_type2ItemDic[ModuleID.GAMEMN].m_path, onGameLoadEventHandle);
            }
            else if (res.refCountResLoadResultNotify.resLoadState.hasFailed())
            {
                onModuleFailed(dispObj);
            }
        }
Пример #3
0
        public void onAutoUpdateLoadEventHandle(IDispatchObject dispObj)
        {
            ResItem res = dispObj as ResItem;

            if (res.refCountResLoadResultNotify.resLoadState.hasSuccessLoaded())
            {
                Ctx.m_instance.m_logSys.debugLog_1(LangItemID.eItem0, res.GetPath());

                Ctx.m_instance.m_layerMgr.m_path2Go[ModulePath.AUTOUPDATEMN]                  = res.InstantiateObject(m_type2ItemDic[ModuleID.AUTOUPDATEMN].m_path);
                Ctx.m_instance.m_layerMgr.m_path2Go[ModulePath.AUTOUPDATEMN].name             = ModuleName.AUTOUPDATEMN;
                Ctx.m_instance.m_layerMgr.m_path2Go[ModulePath.AUTOUPDATEMN].transform.parent = Ctx.m_instance.m_layerMgr.m_path2Go[NotDestroyPath.ND_CV_Root].transform;

                // 立马卸载这个资源
                Ctx.m_instance.m_resLoadMgr.unload(m_type2ItemDic[ModuleID.AUTOUPDATEMN].m_path, onAutoUpdateLoadEventHandle);
            }
            else if (res.refCountResLoadResultNotify.resLoadState.hasFailed())
            {
                onModuleFailed(dispObj);
            }
        }