private static t_animationBeanHF GetConfigImp(int key) { t_animationBeanHF bean = null; GameDll.Tool.StringBuilder.Append("select * from t_animationBean where t_id = "); GameDll.Tool.StringBuilder.Append(key); if (GameDll.DataManager.BeginRead(GameDll.Tool.StringBuilder.ToString())) { bean = new t_animationBeanHF(); bean.t_id = GameDll.DataManager.ReadInt(); bean.t_render_id = GameDll.DataManager.ReadInt(); bean.t_name = GameDll.DataManager.ReadString(); bean.t_fade_in_time = GameDll.DataManager.ReadInt(); bean.t_during = GameDll.DataManager.ReadInt(); bean.t_loop = GameDll.DataManager.ReadInt(); } GameDll.DataManager.EndRead(); GameDll.Tool.StringBuilder.Clear(); if (bean == null) { UnityEngine.Debug.LogError("没有找到配置表,配置表是:t_animationBeanHF Id:" + key); return(null); } return(bean); }
public static t_animationBeanHF GetConfig(int key) { t_animationBeanHF bean = null; if (m_Dic.TryGetValue(key, out bean)) { return(bean); } else { bean = GetConfigImp(key); m_Dic.Add(key, bean); return(bean); } }