public IEnumerator AssetFromBundle(string bundleAssetName, BundleComplete completeCallBack) { yield return(BundleReference.GetInstance.AssetFromBundle(bundleAssetName)); AssetBundle assetBundle = BundleReference.GetInstance.LoadAssetBundle(bundleAssetName); if (assetBundle != null) { completeCallBack.OnComplete(assetBundle); } }
public IEnumerator DownLoadData <T>(BundleComplete completeCallBack) where T : AssetBundleResName, new() { if (!this.LoadBundle()) { yield return(AssetFromBundle(BundleConst.WindowframeBundleName, this)); T instance = new T(); UIPackage bundlePackage = UIPackage.GetByName(instance.ResName); if (null == bundlePackage) { //bundlePackage = UIPackage.AddPackage(assetBundle); this.SetBundlePackageOfPoolInstance(bundlePackage); } //completeCallBack.OnComplete(assetBundle); } }
private void Builder_BundleComplete(ulong packetID, OscBundle bundle) { BundleComplete?.Invoke(packetID, bundle); if (builder.Mode != OscPackageBuilderMode.PackagedAndQueued) { sender.Send(bundle); return; } queue.Enqueue(new QueuedOscBundle() { PacketID = packetID, Bundle = bundle }); if (queue.Count == 1) { Pump(); } }