Exemple #1
0
    private static t_brushBean GetConfigImp(int key)
    {
        t_brushBean bean = null;

        GameDll.Tool.StringBuilder.Append("select * from t_brushBean where t_id = ");
        GameDll.Tool.StringBuilder.Append(key);
        if (GameDll.DataManager.BeginRead(GameDll.Tool.StringBuilder.ToString()))
        {
            bean                 = new t_brushBean();
            bean.t_id            = GameDll.DataManager.ReadInt();
            bean.t_map_id        = GameDll.DataManager.ReadInt();
            bean.t_layer_info    = GameDll.DataManager.ReadString();
            bean.t_pos_range     = GameDll.DataManager.ReadInt();
            bean.t_render_cfg    = GameDll.DataManager.ReadInt();
            bean.t_brush_class   = GameDll.DataManager.ReadInt();
            bean.t_object_type   = GameDll.DataManager.ReadInt();
            bean.t_ai            = GameDll.DataManager.ReadInt();
            bean.t_number        = GameDll.DataManager.ReadInt();
            bean.t_interval_time = GameDll.DataManager.ReadInt();
            bean.t_max_count     = GameDll.DataManager.ReadInt();
        }
        GameDll.DataManager.EndRead();
        GameDll.Tool.StringBuilder.Clear();
        if (bean == null)
        {
            UnityEngine.Debug.LogError("没有找到配置表,配置表是:t_brushBean Id:" + key);
            return(null);
        }
        return(bean);
    }
Exemple #2
0
    public static t_brushBean GetConfig(int key)
    {
        t_brushBean bean = null;

        if (m_Dic.TryGetValue(key, out bean))
        {
            return(bean);
        }
        else
        {
            bean = GetConfigImp(key);
            m_Dic.Add(key, bean);
            return(bean);
        }
    }