public static AssetCallback Gen(OnAssetGot cb, string path) { AssetCallback acb = new AssetCallback(cb, path); items.Add(acb.Id, acb); return(acb); }
public void OnLoaded() { int num = cbs.Count; while (num > 0) { AssetCallback acb = cbs[num - 1]; AssetCallback.Remove(acb.Id); cbs.RemoveAt(num - 1); DoAssetCallback(acb); num = cbs.Count; } }
public void CancelUngotAsset(ulong cbIdx) { AssetCallback acb = AssetCallback.Get(cbIdx); if (null == acb) { return; } BundleHolder holder = GetExistHolder(acb.Path); if (null != holder) { holder.UnRefBy(cbIdx); } }
public ulong RefBy(OnAssetGot cb) { if (this.IsLoaded()) { Ref(); DoCallback(cb); return(0); } else { AssetCallback acb = AssetCallback.Gen(cb, info.path); cbs.Add(acb); Ref(); return(acb.Id); } }
public void UnRefBy(ulong cbId) { int ret = -1; for (int i = 0; i < cbs.Count; ++i) { if (cbs[i].Id == cbId) { ret = i; break; } } if (ret >= 0) { AssetCallback.Remove(cbs[ret].Id); cbs.RemoveAt(ret); UnRef(true); } }
protected override void DoAssetCallback(AssetCallback acb) { acb.Do(assets); }
protected virtual void DoAssetCallback(AssetCallback acb) { acb.Do(MyAsset); }