private void CleanResMap(Func <AbstractRes, bool> condition) { string[] keys = mResDict.Keys.ToArray(); for (int i = 0; i < keys.Length; i++) { AbstractRes res = mResDict[keys[i]]; if (condition(res)) { if (res.ReleaseRes()) { mResDict.Remove(keys[i]); ResFactory.Recycle(res); } } } }
public AbstractRes GetRes(ResName resName, bool createNew = false) { AbstractRes res; if (mResDict.TryGetValue(resName.FullName, out res)) { return(res); } if (!createNew) { return(null); } res = ResFactory.Create(resName); if (res != null) { mResDict.Add(resName.FullName, res); GetAllLoadedAssetBundles(); } return(res); }