Example #1
0
    public IReader GetReader(string path)
    {
        IReader reader = null;

        if (_readersDic.ContainsKey(path))
        {
            reader = _readersDic[path];
        }
        else
        {
            reader = ReaderConfig.GetReader(path);
            LoadMgr.Single.LoadConfig(path, (data) => reader.SetData(data));
            _readersDic[path] = reader;
        }

        return(reader);
    }
Example #2
0
    public IReader GetReader(string path)
    {
        IReader reader = null;

        if (_readersDic.ContainsKey(path))
        {
            reader = _readersDic[path];
        }
        else
        {
            //从当前的配置中,获取一个新的reader
            reader = ReaderConfig.GetReader(path);
            if (reader != null)
            {
                //读取当前路径配置数据,赋值给reader
                _readersDic[path] = reader;
            }
            else
            {
                Debug.LogError("未获取到对应的reader,路径:" + path);
            }
        }
        return(reader);
    }
Example #3
0
    public IReader GetReader(string path)
    {
        IReader reader = null;

        if (_readersDic.ContainsKey(path))
        {
            reader = _readersDic[path];
        }
        else
        {
            reader = ReaderConfig.GetReader(path);
            LoadMgr.Single.LoadConfig(path, data => reader.SetData(data));
            if (reader != null)
            {
                _readersDic[path] = reader;
            }
            else
            {
                Debug.LogError("未获取到对应reader,路径:" + path);
            }
        }

        return(reader);
    }