public void Exit <T>() where T : BaseCtrl { var findCtrl = FindCtrl <T>(); if (findCtrl == currMainCtrl) { //先打开上一组 ctrl 之后也改成异步回调之后再关闭 currMainCtrl = null; var nextIndex = ctrlCacheList.Count - 2; findCtrl.Inactive(); findCtrl.Exit(); ctrlCacheList.Remove(findCtrl); if (nextIndex >= 0) { BaseCtrl currCtrl = ctrlCacheList[nextIndex]; currCtrl.Active(); currMainCtrl = currCtrl; } } else { Logx.LogError("findCtrl == ctrl : " + typeof(T) + " != " + currMainCtrl?.GetType()); return; } }
public void OnOneResLoadFinish(string currPath, UnityEngine.Object asset) { if (currNeedLoadSet.Contains(currPath)) { currNeedLoadSet.Remove(currPath); } else { Logx.LogError("the currPath is not correct : " + currPath); } }
public override void OnPrepareFinish() { var assetBundleCache = AssetBundleManager.Instance.GetCacheByPath(abPath); if (null == assetBundleCache) { Logx.LogError("AssetLoader", "the assetBundleCache is null : " + abPath); return; } if (null == assetBundleCache.assetBundle) { Logx.LogError("AssetLoader", "the assetBundleCache.assetBundle is null : " + abPath); return; } var ab = assetBundleCache.assetBundle; assetRequest = ab.LoadAssetAsync(path); }
public T GetById <T>(int id) where T : Table.BaseTable { var type = typeof(T); if (typeToDicConfigDic.ContainsKey(type)) { var dataDic = typeToDicConfigDic[type]; if (dataDic.ContainsKey(id)) { var data = dataDic[id]; return(data as T); } else { Logx.LogError("Table", "the id is not found : " + id); } } else { Logx.LogError("Table", "the type is not found : " + type); } return(null); }