public void LoadAtom(BankLoadRequestStruct requrest, BankResultHandler handler, GameObject target, object userData = null) { AKRESULT result; AKBankAtom atom = bankAtomSet.Get(requrest.bnkName); if (atom == null) { if (requrest.ignoreIfAssetNotExist) { if (handler != null) { handler(BankLoadResponseStruct.Create(requrest.bnkName, AKRESULT.AK_BankNotLoadYet)); } return; } atom = bankAtomSet.Register(requrest, false); } else { result = bankAtomSet.Vertify(atom); if (result != AKRESULT.AK_Success) { if (handler != null) { handler(BankLoadResponseStruct.Create(requrest.bnkName, result, target, userData)); } return; } } atom.Load(handler, target, userData); }
//TODO:异步加载 public void Load(BankResultHandler callback, GameObject target, object userData = null) { onLoadBefore(this); AKRESULT result = AkBankManager.LoadBankRes(BankName, false, false); BankLoadResponseStruct callbackData = new BankLoadResponseStruct(); callbackData.loadResult = result; callbackData.callback = callback; callbackData.userData = userData; callbackData.target = target; callbackData.atom = this; callbackData.bnkName = BankName; onLoadFinish(callbackData); }
public void LoadAtom(string bankName, BankResultHandler handler, GameObject target, object userData = null) { LoadAtom(new BankLoadRequestStruct(bankName), handler, target, userData); }