Example #1
0
        /// <summary>
        /// 初始化必要AssetBulde
        /// </summary>
        /// <returns></returns>
        static bool InitializeBundle()
        {
            //资源目录
            string relativePath = Path.Combine(ResUtility.AssetBundlesOutputPath, ResUtility.GetPlatformPath);
            var    url          =
#if UNITY_EDITOR
                relativePath + "/";
#else
                ResUtility.GetDataPathByPlatform;
#endif
            if (MyBundles.Initialize(url))                                                    //初始化Bundles信息
            {
                var bundle = MyBundles.Load(RuntimeResPath.GetManifestAssetPathExceptSuffix); //卸载配置文件
                if (bundle != null)
                {
                    InitManifest(bundle);
                    bundle.Release();
                    MyDebug.Log("manifest Load Is Complete!");
                }
                return(true);
            }
            MyDebug.LogErrorFormat("bundle manifest not exist.!");
            return(false);
        }
 protected override void OnLoad()
 {
     bundle = MyBundles.LoadSync(MyAssets.GetBundleByAssetName(assetName));
 }
Example #3
0
        public void OnLoadManifest()
        {
            var request = MyBundles.Load(RuntimeResPath.GetManifestAssetPathExceptSuffix);

            asset = request.LoadAsset(RuntimeResPath.GetManifestAssetPath, assetType);
        }
Example #4
0
 protected override void OnLoad()
 {
     bundle = MyBundles.Load(MyAssets.GetBundleByAssetName(assetName));
     asset  = bundle.LoadAsset(MyAssets.GetAssetPathByAssetName(assetName), assetType);
 }