Exemplo n.º 1
0
        //ProcessFrame is like "the Update of Timeline"
        public override void ProcessFrame(Playable playable, FrameData info, object arg)
        {
            //Insert logic per frame in here
            var inputPlayable = (ScriptPlayable <SimpleBehaviour>)playable.GetInput(0);

            LogCat.Log(message);
        }
Exemplo n.º 2
0
        public IEnumerator Initialize()
        {
            if (Application.isEditor && EditorModeConst.IsEditorMode)
            {
                yield break;
            }

            manifest       = new Manifest();
            assetPathMap   = new AssetPathMap();
            assetBundleMap = new AssetBundleMap();

            // 说明:同时请求资源可以提高加载速度
            var manifestRequest =
                DownloadFileAsyncNoCache(
                    manifest.assetBundleName.WithRootPath(FilePathConst.PersistentAssetBundleRoot));
            var assetPathMapRequest =
                DownloadFileAsyncNoCache(
                    BuildConst.AssetPathMap_File_Name.WithRootPath(FilePathConst.PersistentAssetBundleRoot));
            var assetBundleMapRequest =
                DownloadFileAsyncNoCache(
                    BuildConst.AssetBundleMap_File_Name.WithRootPath(FilePathConst.PersistentAssetBundleRoot));

            yield return(manifestRequest);

            if (manifestRequest.error.IsNullOrWhiteSpace())
            {
                var assetBundle = manifestRequest.assetBundle;
                manifest.LoadFromAssetBundle(assetBundle);
                assetBundle.Unload(false);
                manifestRequest.Destroy();
                PoolCatManagerUtil.Despawn(manifestRequest);
            }


            yield return(assetPathMapRequest);

            if (assetPathMapRequest.error.IsNullOrWhiteSpace())
            {
                assetPathMap.Initialize(assetPathMapRequest.text);
                assetPathMapRequest.Destroy();
                PoolCatManagerUtil.Despawn(assetPathMapRequest);
            }

            yield return(assetBundleMapRequest);

            if (assetBundleMapRequest.error.IsNullOrWhiteSpace())
            {
                assetBundleMap.Initialize(assetBundleMapRequest.text);
                assetBundleMapRequest.Destroy();
                PoolCatManagerUtil.Despawn(assetBundleMapRequest);
            }

            LogCat.Log("AssetMananger init finished");
        }