예제 #1
0
    private static t_skillBean GetConfigImp(int key)
    {
        t_skillBean bean = null;

        GameDll.Tool.StringBuilder.Append("select * from t_skillBean where t_id = ");
        GameDll.Tool.StringBuilder.Append(key);
        if (GameDll.DataManager.BeginRead(GameDll.Tool.StringBuilder.ToString()))
        {
            bean                         = new t_skillBean();
            bean.t_id                    = GameDll.DataManager.ReadInt();
            bean.t_class                 = GameDll.DataManager.ReadInt();
            bean.t_cast_time             = GameDll.DataManager.ReadInt();
            bean.t_continue              = GameDll.DataManager.ReadInt();
            bean.t_continue_time         = GameDll.DataManager.ReadInt();
            bean.t_add_buff              = GameDll.DataManager.ReadString();
            bean.t_eff_id                = GameDll.DataManager.ReadInt();
            bean.t_range                 = GameDll.DataManager.ReadInt();
            bean.t_cast_distance         = GameDll.DataManager.ReadInt();
            bean.t_skill_icon            = GameDll.DataManager.ReadString();
            bean.t_skill_icon_set_abname = GameDll.DataManager.ReadString();
            bean.t_skill_icon_set        = GameDll.DataManager.ReadString();
            bean.t_cooldown_time         = GameDll.DataManager.ReadInt();
            bean.t_target_pos_type       = GameDll.DataManager.ReadInt();
            bean.t_target_num_type       = GameDll.DataManager.ReadInt();
        }
        GameDll.DataManager.EndRead();
        GameDll.Tool.StringBuilder.Clear();
        if (bean == null)
        {
            UnityEngine.Debug.LogError("没有找到配置表,配置表是:t_skillBean Id:" + key);
            return(null);
        }
        return(bean);
    }
예제 #2
0
    public static t_skillBean GetConfig(int key)
    {
        t_skillBean bean = null;

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