Пример #1
0
        // 测试 .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);
        }
Пример #2
0
        // 异步加载
        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);
        }
Пример #3
0
        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);
        }
Пример #4
0
        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);
        }
Пример #5
0
        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 ;
        }
Пример #6
0
        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);
        }
Пример #7
0
        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);
        }
Пример #8
0
        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);
        }