virtual public void loadFile() { LoadParam param = Ctx.m_instance.m_poolSys.newObject <LoadParam>(); LocalFileSys.modifyLoadParam(FILE_LIST, param); param.m_loadEventHandle = onLoadEventHandle; Ctx.m_instance.m_resLoadMgr.loadData(param); Ctx.m_instance.m_poolSys.deleteObj(param); }
// 从本地磁盘或者网络加载资源 protected void loadFromFile(string reaPath, Action <IDispatchObject> onLoadEventHandle) { LoadParam param = Ctx.m_instance.m_poolSys.newObject <LoadParam>(); LocalFileSys.modifyLoadParam(reaPath, param); param.m_loadNeedCoroutine = false; param.m_resNeedCoroutine = false; param.m_loadEventHandle = onLoadEventHandle; Ctx.m_instance.m_uiPrefabMgr.load <UIPrefabRes>(param); Ctx.m_instance.m_poolSys.deleteObj(param); }
public void loadFile() { string name = "forbidWords.txt"; LoadParam param = Ctx.m_instance.m_poolSys.newObject <LoadParam>(); LocalFileSys.modifyLoadParam(Path.Combine(Ctx.m_instance.m_cfg.m_pathLst[(int)ResPathType.ePathWord], name), param); param.m_loadEventHandle = onLoadEventHandle; param.m_loadNeedCoroutine = false; param.m_resNeedCoroutine = false; Ctx.m_instance.m_resLoadMgr.loadResources(param); Ctx.m_instance.m_poolSys.deleteObj(param); }
public void syncLoadImage(string atlasName, string spriteName) { LoadParam param; param = Ctx.m_instance.m_poolSys.newObject <LoadParam>(); LocalFileSys.modifyLoadParam(atlasName, param); param.m_subPath = spriteName; param.m_loadNeedCoroutine = false; param.m_resNeedCoroutine = false; loadImage(param); Ctx.m_instance.m_poolSys.deleteObj(param); }
public void loadSceneRes(string filename) { Ctx.m_instance.m_netDispList.bStopNetHandle = true; // 加载场景需要停止处理消息,因为很多资源都要等到场景加载完成才初始化 LoadParam param = Ctx.m_instance.m_poolSys.newObject <LoadParam>(); LocalFileSys.modifyLoadParam(string.Format("{0}{1}", Ctx.m_instance.m_cfg.m_pathLst[(int)ResPathType.ePathScene], filename), param); param.m_loadEventHandle = onSceneResLoadded; param.m_resNeedCoroutine = true; param.m_loadNeedCoroutine = true; Ctx.m_instance.m_resLoadMgr.loadLevel(param); Ctx.m_instance.m_poolSys.deleteObj(param); }
// 加载一个表 public void loadOneTable(TableID tableID) { TableBase table = m_dicTable[tableID]; LoadParam param = Ctx.m_instance.m_poolSys.newObject <LoadParam>(); LocalFileSys.modifyLoadParam(Path.Combine(Ctx.m_instance.m_cfg.m_pathLst[(int)ResPathType.ePathTablePath], table.m_resName), param); param.m_loadEventHandle = onLoadEventHandle; param.m_loadNeedCoroutine = false; param.m_resNeedCoroutine = false; Ctx.m_instance.m_resLoadMgr.loadResources(param); Ctx.m_instance.m_poolSys.deleteObj(param); }
public T getAndAsyncLoad <T>(string path, Action <IDispatchObject> handle) where T : InsResBase, new() { T ret = null; LoadParam param = Ctx.m_instance.m_poolSys.newObject <LoadParam>(); LocalFileSys.modifyLoadParam(path, param); param.m_loadNeedCoroutine = true; param.m_resNeedCoroutine = true; param.m_loadEventHandle = handle; ret = getAndLoad <T>(param); Ctx.m_instance.m_poolSys.deleteObj(param); return(ret); }
//<?xml version="1.0" encoding="utf-8"?> //<!-- type 就是一个功能 item 就是一项,顺序千万不要乱,否则都乱了 --> //<msg> // <t> // <i>数据结构</i> // </t> //</msg> public void loadXml() { if (!m_isLoaded) { m_isLoaded = true; LoadParam param = Ctx.m_instance.m_poolSys.newObject <LoadParam>(); param.m_loadNeedCoroutine = false; param.m_resNeedCoroutine = false; LocalFileSys.modifyLoadParam(m_ID2FileName[m_langID].m_filePath, param); param.m_loadEventHandle = onLoadEventHandle; Ctx.m_instance.m_resLoadMgr.loadResources(param); Ctx.m_instance.m_poolSys.deleteObj(param); } }
protected void loadCfg <T>(XmlCfgID id) where T : XmlCfgBase, new() { T item = new T(); m_id2CfgDic[id] = item; LoadParam param = Ctx.m_instance.m_poolSys.newObject <LoadParam>(); LocalFileSys.modifyLoadParam(item.m_path, param); param.m_loadEventHandle = onLoadEventHandle; param.m_loadNeedCoroutine = false; param.m_resNeedCoroutine = false; Ctx.m_instance.m_resLoadMgr.loadResources(param); Ctx.m_instance.m_poolSys.deleteObj(param); }
// 加载游戏模块 public void loadModule(ModuleID moduleID) { if (!m_type2ItemDic[moduleID].m_isLoaded) { // 初始化完成,开始加载自己的游戏场景 LoadParam param = Ctx.m_instance.m_poolSys.newObject <LoadParam>(); LocalFileSys.modifyLoadParam(m_type2ItemDic[moduleID].m_path, param); param.m_loadEventHandle = m_type2ItemDic[moduleID].m_loadEventHandle; Ctx.m_instance.m_resLoadMgr.loadResources(param); Ctx.m_instance.m_poolSys.deleteObj(param); } else { Ctx.m_instance.m_logSys.log("模块重复加载"); } }