// 测试 .anim 动画 protected void testAnim() { LoadParam param = Ctx.m_instance.m_poolSys.newObject <LoadParam>(); string resPath = "Anim/boxcampush"; LocalFileSys.modifyLoadParam(resPath, param); param.m_loadEventHandle = onLoadEventHandle; Ctx.m_instance.m_resLoadMgr.loadResources(param); Ctx.m_instance.m_poolSys.deleteObj(param); }
// 异步加载 public void loadBT(BTID id) { LoadParam param = Ctx.m_instance.m_poolSys.newObject <LoadParam>(); LocalFileSys.modifyLoadParam(m_btAttrSys.m_id2ItemDic[id].m_path, param); param.m_loadNeedCoroutine = false; param.m_resNeedCoroutine = false; load <BehaviorTreeRes>(param); Ctx.m_instance.m_poolSys.deleteObj(param); }
protected void testAsyncLoadImage() { LoadParam param; param = Ctx.m_instance.m_poolSys.newObject <LoadParam>(); LocalFileSys.modifyLoadParam(CVAtlasName.TuJianDyn, param); param.m_subPath = "ka1_paizu"; param.m_loadEventHandle = onImageLoadEventHandle; Ctx.m_instance.m_atlasMgr.getAndLoadImage(param); Ctx.m_instance.m_poolSys.deleteObj(param); }
protected void testLoadScriptAnimatorControllerPrefab() { string path = string.Format("{0}{1}", Ctx.m_instance.m_cfg.m_pathLst[(int)ResPathType.ePathSceneAnimatorController], "SelfCardAni.asset"); LoadParam param; param = Ctx.m_instance.m_poolSys.newObject <LoadParam>(); LocalFileSys.modifyLoadParam(path, param); param.m_loadNeedCoroutine = false; param.m_resNeedCoroutine = false; PrefabResItem bbb = Ctx.m_instance.m_resLoadMgr.getAndLoad(param) as PrefabResItem; Ctx.m_instance.m_poolSys.deleteObj(param); }
protected void testLoadAnimatorController() { LoadParam param; param = Ctx.m_instance.m_poolSys.newObject <LoadParam>(); LocalFileSys.modifyLoadParam("Animation/Scene/CommonCard.controller", param); param.m_loadNeedCoroutine = false; param.m_resNeedCoroutine = false; ResItem bbb = Ctx.m_instance.m_resLoadMgr.getAndLoad(param); System.Type type = bbb.getObject("").GetType(); Ctx.m_instance.m_logSys.log(string.Format("类型名字 {0}", type.FullName)); Ctx.m_instance.m_poolSys.deleteObj(param); //GameObject _go = UtilApi.createGameObject("AnimatorController"); //Animator animator = _go.AddComponent<Animator>(); //animator.runtimeAnimatorController = bbb.getObject() as ; }
public void testAsyncLoadUIPrefabRefCount() { LoadParam param; param = Ctx.m_instance.m_poolSys.newObject <LoadParam>(); LocalFileSys.modifyLoadParam("UI/UIChat/UIChat.prefab", param); param.m_loadEventHandle = onUIPrefabLoadEventHandle; UIPrefabRes aaa = Ctx.m_instance.m_uiPrefabMgr.getAndLoad <UIPrefabRes>(param); Ctx.m_instance.m_poolSys.deleteObj(param); Ctx.m_instance.m_uiPrefabMgr.unload(aaa.GetPath(), onUIPrefabLoadEventHandle); param = Ctx.m_instance.m_poolSys.newObject <LoadParam>(); LocalFileSys.modifyLoadParam("UI/UIChat/UIChat.prefab", param); param.m_loadEventHandle = onUIPrefabLoadEventHandle; UIPrefabRes bbb = Ctx.m_instance.m_uiPrefabMgr.getAndLoad <UIPrefabRes>(param); Ctx.m_instance.m_poolSys.deleteObj(param); Ctx.m_instance.m_uiPrefabMgr.unload(bbb.GetPath(), onUIPrefabLoadEventHandle); }
protected void testLoadAnimatorControllerPrefab() { LoadParam param; param = Ctx.m_instance.m_poolSys.newObject <LoadParam>(); LocalFileSys.modifyLoadParam("Animation/Scene/Control.prefab", param); param.m_loadNeedCoroutine = false; param.m_resNeedCoroutine = false; PrefabResItem bbb = Ctx.m_instance.m_resLoadMgr.getAndLoad(param) as PrefabResItem; Ctx.m_instance.m_poolSys.deleteObj(param); GameObject _go = UtilApi.createGameObject("AnimatorController"); Animator animator = _go.AddComponent <Animator>(); GameObject _insObj = bbb.InstantiateObject(""); RuntimeAnimatorController controlCom = _insObj.GetComponent <Animator>().runtimeAnimatorController; //_insObj.GetComponent<Animator>().runtimeAnimatorController = null; RuntimeAnimatorController copyCom = RuntimeAnimatorController.Instantiate(controlCom); animator.runtimeAnimatorController = copyCom; //UtilApi.SetParent(_insObj, _go); UtilApi.Destroy(_insObj); }
public void testAsyncLoadAtlasRefCount() { LoadParam param; param = Ctx.m_instance.m_poolSys.newObject <LoadParam>(); LocalFileSys.modifyLoadParam(CVAtlasName.TuJianDyn, param); param.m_subPath = "ka1_paizu"; param.m_loadEventHandle = onImageLoadEventHandle; ImageItem aaa = Ctx.m_instance.m_atlasMgr.getAndLoadImage(param); Ctx.m_instance.m_poolSys.deleteObj(param); param = Ctx.m_instance.m_poolSys.newObject <LoadParam>(); LocalFileSys.modifyLoadParam(CVAtlasName.TuJianDyn, param); param.m_subPath = "ka1_paizu"; param.m_loadEventHandle = onImageLoadEventHandle; ImageItem bbb = Ctx.m_instance.m_atlasMgr.getAndLoadImage(param); Ctx.m_instance.m_poolSys.deleteObj(param); Ctx.m_instance.m_atlasMgr.unloadImage(aaa, onImageLoadEventHandle); Ctx.m_instance.m_atlasMgr.unloadImage(bbb, onImageLoadEventHandle); }