Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        //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);
        }
Exemplo n.º 3
0
 public void LoadAtom(string bankName, BankResultHandler handler, GameObject target, object userData = null)
 {
     LoadAtom(new BankLoadRequestStruct(bankName), handler, target, userData);
 }