/// <summary> /// Load the asset bundle with specified uri. /// </summary> /// <param name="uri">path to the assset bundle </param> public static AssetBundleRef Load(string uri, int ttl) { #if PROFILE_FILE Profiler.BeginSample("BundleHelper.Load"); #endif uri = fixBundleUri(uri); var result = BundleManager.Load(uri, ttl); #if PROFILE_FILE Profiler.EndSample(); #endif return(result); }
public void LoadAllDependencies(string fname, int ttl) { if (manifest == null) { LogUtil.Error("manifest==null"); return; } #if PROFILE_FILE Profiler.BeginSample("BundleDependencies.LoadAllDependencies"); #endif string dpname = fname.Replace("\\", "/"); // int idx = dpname.LastIndexOf("/") + 1; // dpname = dpname.Substring(idx, dpname.Length - idx); // Get dependecies from the AssetBundleManifest object.. string[] dependencies = manifest.GetAllDependencies(dpname); var length = dependencies.Length; if (length == 0) { return; } // Record and load all dependencies. for (int i = 0; i < length; i++) { var depend = RemapVariantName(dependencies[i]); LogUtil.Trace(fname + ":dependancy:" + depend); var bundle = BundleManager.Load(depend, ttl); if (bundle != null) { bundle.AddParentBundle(fname); } } #if PROFILE_FILE Profiler.EndSample(); #endif }