Esempio n. 1
0
 public void Dispose()
 {
     this.resName    = null;
     this.bundleName = null;
     this.sceneName  = null;
     this.func.Dispose();
     this.next = null;
 }
Esempio n. 2
0
 public LuaResCallBackNode(string tmpRes, string tmpBundle, string tmpScene, LuaFunction tmpFunc, bool tmpIsSingle, LuaResCallBackNode tmpNode)
 {
     this.resName    = tmpRes;
     this.bundleName = tmpBundle;
     this.sceneName  = tmpScene;
     this.func       = tmpFunc;
     this.isSingle   = tmpIsSingle;
     this.next       = tmpNode;
 }
Esempio n. 3
0
 public void GetResource(string sceneName, string bundleName, string res, bool single, LuaFunction luaFunc)
 {
     //没有加载
     if (!ILoadManager.Instance.IsLoadingAssetBundle(sceneName, bundleName))
     {
         ILoadManager.Instance.LoadAsset(sceneName, bundleName, LoadProgress);
         string bundleFullName = ILoadManager.Instance.GetBundleRelateName(sceneName, bundleName);
         if (bundleFullName != null)
         {
             LuaResCallBackNode tmpNode = new LuaResCallBackNode(res, bundleFullName, sceneName, luaFunc, single, null);
             CallBackManager.AddBundleCallBack(bundleFullName, tmpNode);
         }
         else
         {
             Debug.Log("Do not contain bundle==" + bundleName);
         }
     }
     else if (ILoadManager.Instance.IsLoadingBundleFinish(sceneName, bundleName))
     {
         if (single)
         {
             Object tmpObj = ILoadManager.Instance.GetSingleResource(sceneName, bundleName, res);
             //this.ReleaseBack.Changer(backId, tmpObj);
             //SendMsg(ReleaseBack);
             luaFunc.Call(sceneName, bundleName, res, tmpObj);
         }
         else
         {
             Object[] tmpObj = ILoadManager.Instance.GetMultiResource(sceneName, bundleName, res);
             //this.ReleaseBack.Changer(backId, tmpObj);
             //SendMsg(ReleaseBack);
             luaFunc.Call(sceneName, bundleName, res, tmpObj);
         }
     }
     else
     {
         //已经加载但是没有完成
         string bundleFullName = ILoadManager.Instance.GetBundleRelateName(sceneName, bundleName);
         if (bundleFullName != null)
         {
             LuaResCallBackNode tmpNode = new LuaResCallBackNode(res, bundleFullName, sceneName, luaFunc, single, null);
             CallBackManager.AddBundleCallBack(bundleFullName, tmpNode);
         }
         else
         {
             Debug.Log("Do not contain bundle==" + bundleName);
         }
     }
 }
Esempio n. 4
0
 public void Dispose(string bundle)
 {
     if (manager.ContainsKey(bundle))
     {
         LuaResCallBackNode topNode = manager[bundle];
         while (topNode.next != null)
         {
             LuaResCallBackNode curNode = topNode;
             topNode = topNode.next;
             curNode.Dispose();
         }
         topNode.Dispose();
         manager.Remove(bundle);
     }
 }
Esempio n. 5
0
 public void  AddBundleCallBack(string bundle, LuaResCallBackNode tmpNode)
 {
     if (manager.ContainsKey(bundle))
     {
         LuaResCallBackNode TopNode = manager[bundle];
         while (TopNode.next != null)
         {
             TopNode = TopNode.next;
         }
         TopNode.next = tmpNode;
     }
     else
     {
         manager.Add(bundle, tmpNode);
     }
 }
Esempio n. 6
0
 public void CallBackLua(string bundle)
 {
     if (manager.ContainsKey(bundle))
     {
         LuaResCallBackNode topNode = manager[bundle];
         do
         {
             if (topNode.isSingle)
             {
                 object tmpObj = ILoadManager.Instance.GetSingleResource(topNode.sceneName, topNode.bundleName, topNode.resName);
                 topNode.func.Call(topNode.sceneName, topNode.bundleName, topNode.resName, tmpObj);
             }
             else
             {
                 object[] tmpObj = ILoadManager.Instance.GetMultiResource(topNode.sceneName, topNode.bundleName, topNode.resName);
                 topNode.func.Call(topNode.sceneName, topNode.bundleName, topNode.resName, tmpObj);
             }
             topNode = topNode.next;
         } while (topNode != null);
     }
 }