コード例 #1
0
ファイル: t_jubianBeanHF.cs プロジェクト: zjljxsc/cshotfix
    public static t_jubianBeanHF GetConfig(int key)
    {
        t_jubianBeanHF bean = null;

        if (m_Dic.TryGetValue(key, out bean))
        {
            return(bean);
        }
        else
        {
            bean = GetConfigImp(key);
            m_Dic.Add(key, bean);
            return(bean);
        }
    }
コード例 #2
0
ファイル: t_jubianBeanHF.cs プロジェクト: zjljxsc/cshotfix
    private static t_jubianBeanHF GetConfigImp(int key)
    {
        t_jubianBeanHF bean = null;

        GameDll.Tool.StringBuilder.Append("select * from t_jubianBean where t_id = ");
        GameDll.Tool.StringBuilder.Append(key);
        if (GameDll.DataManager.BeginRead(GameDll.Tool.StringBuilder.ToString()))
        {
            bean        = new t_jubianBeanHF();
            bean.t_id   = GameDll.DataManager.ReadInt();
            bean.t_path = GameDll.DataManager.ReadString();
            bean.t_name = GameDll.DataManager.ReadString();
            bean.t_type = GameDll.DataManager.ReadString();
        }
        GameDll.DataManager.EndRead();
        GameDll.Tool.StringBuilder.Clear();
        if (bean == null)
        {
            UnityEngine.Debug.LogError("没有找到配置表,配置表是:t_jubianBeanHF Id:" + key);
            return(null);
        }
        return(bean);
    }