public static bool init() { if (ctx.i < ctx.files.Length) { var abi = ++ABIDX; var subname = ctx.files[ctx.i]; var name = Path.Combine(ROOT, subname); var ab = AssetBundle.LoadFromFile(name); var asset_child = ab.GetAllAssetNames(); var scene_child = ab.GetAllScenePaths(); abi_to_name[abi] = subname; name_to_abi[subname] = abi; for (int i = 0; i < asset_child.Length; i++) { var s = asset_child[i]; DBGPRINT("Asset:" + s + " -> " + subname); abi_of_asset[s] = abi; } for (int i = 0; i < scene_child.Length; i++) { var s = scene_child[i]; DBGPRINT("Scene:" + s + " -> " + subname); abi_of_asset[s] = abi; } ab.Unload(true); ctx.i++; return(true); } else { ctx = null; return(false); } }
public static int start(string path) { ctx = new initctx(); var c = path[path.Length - 1]; var ab = AssetBundle.LoadFromFile(Path.Combine(path, MAINNAME)); MANIFEST = ab.LoadAsset <AssetBundleManifest>("AssetBundleManifest"); ab.Unload(false); ROOT = path; ctx.i = 0; ctx.files = MANIFEST.GetAllAssetBundles(); return(ctx.files.Length); }