public void AsyncLoad(string bundlePath, string assetName, LoadDelegate lad) { StartCoroutine(AsyncLoadBundle(bundlePath, delegate(BundleHolder bh) { if (bh == null) { lad?.Invoke(null); return; } StartCoroutine(AsyncLoadAsset(bh.bundle, assetName, delegate(Object obj) { if (obj == null) { lad?.Invoke(null); bh.TryRelease(); return; } AssetRef ar = new AssetRef(); ar.asset = obj; ar.bh = bh; ar.Retain(); lad?.Invoke(ar); bh.TryRelease(); })); })); }
/// <summary> /// Invoke all registered Load methods. /// </summary> public void LoadAll(bool suppressException = true) { LoadDelegate?.Invoke(suppressException); }