Пример #1
0
        /// <summary>
        /// 注册加载
        /// </summary>
        /// <param name="type"></param>
        /// <param name="callBack"></param>
        /// <param name="fileName">配置文件路径 类似 "Configuration/GameData/Hero"</param>
        /// <returns></returns>
        void registloadData(E_StaticDB_DBType type, Action <string> callBack, string fileName)
        {
            m_dictInited[type] = false;
            TextAsset text = Resources.Load(fileName) as TextAsset;
            string    str  = text != null?text.ToString() : string.Empty;

            m_dictLists[type] = new KeyValuePair <Action <string>, string>(callBack, str);
        }
Пример #2
0
        internal bool initData(E_StaticDB_DBType type)
        {
            if (m_dictInited[type])
            {
                return(true);
            }

            m_dictInited[type] = loadData(type);

            return(m_dictInited[type]);
        }
Пример #3
0
        bool loadData(E_StaticDB_DBType type)
        {
            KeyValuePair <Action <string>, string> keyValue = m_dictLists[type];

            if (string.IsNullOrEmpty(keyValue.Value))
            {
                return(false);
            }
            else
            {
                keyValue.Key(keyValue.Value);
            }
            return(true);
        }