public static T Get <T>(string abName, string assetName, AssetType assetType, bool isDep = false) where T : HRes, new() { HRes res = null; abName = RemapVariantName(abName.ToLower(), isDep); assetName = assetName.ToLower(); string resName = GetResName(abName, assetName); if (!mResMap.TryGetValue(resName, out res)) { res = new T(); mResMap.Add(resName, res); res.Init(abName, assetName, resName, assetType); } res.RefCount++; return(res as T); }
public void Release(string abName, string assetName) { if (abName == null || assetName == null) { Debug.LogError("Release abName or assetName is null!!!"); return; } HRes res; abName = abName.ToLower(); assetName = assetName.ToLower(); string name = HRes.GetResName(abName, assetName); if (HRes.mResMap.TryGetValue(name, out res)) { res.Release(); } }
public void ActivateVariantName(string name) { HRes.ActivateVariantName(name); }