public void Initialize() { m_dicLocalResData = new Dictionary <uint, CMResourceDefine.LocalResourceData>(); m_atlas = new Dictionary <string, CMAtlas>(); m_fonts = new Dictionary <string, CMFont>(); m_objs = new Dictionary <string, CMObj>(); m_texs = new Dictionary <string, CMTexture>(); List <table.UIResourceDataBase> resList = GameTableManager.Instance.GetTableList <table.UIResourceDataBase>(); if (null != resList) { table.UIResourceDataBase db = null; CMResourceDefine.LocalResourceData localData = null; for (int i = 0, max = resList.Count; i < max; i++) { db = resList[i]; localData = CMResourceDefine.LocalResourceData.Create(db.ID); m_dicLocalResData.Add(db.ID, localData); } } }
/// <summary> /// 获取资源路径 /// </summary> /// <param name="resId"></param> /// <returns></returns> public static string GetResPathByResID(uint resId) { CMResourceDefine.LocalResourceData ld = DataManager.Manager <CMResourceMgr>().GetLocalResourceData(resId); return((null != ld) ? ld.ResRelativePath : ""); }