Exemplo n.º 1
0
    /// <summary>
    /// 事先缓存一些数据,防止在第一次获取到数据时,有卡顿
    /// </summary>
    void CacahData()
    {
        //添加需要事先加载的委托
        //_cacheDelegate += LoadUIResPathData;

        if (_cacheDelegate != null)
        {
            _cacheDelegate(_cacheData);
            _cacheDelegate = null;
        }
    }
Exemplo n.º 2
0
    Dictionary <string, object> GetDic(Type type, LoadTableDelegate callBack)
    {
        string tableName = type.Name;
        Dictionary <string, object> resTable = null;

        if (_cacheData.ContainsKey(tableName))
        {
            resTable = _cacheData[tableName];
        }
        else if (_tmpData.ContainsKey(tableName))
        {
            resTable = _tmpData[tableName];
        }
        else
        {
            callBack(_tmpData);
            resTable = _tmpData[tableName];
        }
        return(resTable);
    }