Exemplo n.º 1
0
    public static t_growupBean GetConfig(int key)
    {
        t_growupBean bean = null;

        if (m_Dic.TryGetValue(key, out bean))
        {
            return(bean);
        }
        else
        {
            bean = GetConfigImp(key);
            m_Dic.Add(key, bean);
            return(bean);
        }
    }
Exemplo n.º 2
0
    private static t_growupBean GetConfigImp(int key)
    {
        t_growupBean bean = null;

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