private AssetPackABImpl LoadAssetPackAuto(string abname) { string[] deps = m_manifest.GetDirectDependencies(abname); foreach (string depAbname in deps) { AssetPackABImpl depAp = GetAssetBundle(depAbname); } string abpath = Path.Combine(FileArtPath, abname); AssetBundle ab = AssetBundle.LoadFromFile(abpath); return(new AssetPackABImpl(ab)); }
private AssetPackABImpl GetAssetBundle(string abname) { AssetPackABImpl ap = null; if (!m_ab_map.TryGetValue(abname, out ap)) { ap = LoadAssetPackAuto(abname); m_ab_map.Add(abname, ap); } ap.Lock(); return(ap); }
public override void UnloadPack(string abname) { string realname = GetRealABName(abname); //减去引用计数,当计数为0时卸载AB AssetPackABImpl ap = null; if (m_ab_map.TryGetValue(realname, out ap)) { if (ap.Unlock()) { ap.Unload(); string[] depNames = m_manifest.GetDirectDependencies(realname); foreach (var depName in depNames) { UnloadPack(depName); } } } }
public override AssetPack LoadPack(string abname) { AssetPackABImpl ret = GetAssetBundle(GetRealABName(abname)); return(ret); }