少年修仙传客户端基础资源
hch
2024-05-10 fa4cc12cfdca5df9d65dd03b0c1c8caa3f220762
0312 utf写文件
4个文件已修改
38 ■■■■ 已修改文件
Assets/Editor/ScriptTemplate/ConfigDataTemplate.txt 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/Tool/TableTool.cs 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Launch/LoadDll.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Launch/ResourcesModel.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Assets/Editor/ScriptTemplate/ConfigDataTemplate.txt
@@ -157,6 +157,7 @@
        }
        else
        {
            bool isEditor = AssetSource.refdataFromEditor;
            ThreadPool.QueueUserWorkItem((object _object) =>
            {
                var lines = File.ReadAllLines(path);
@@ -169,7 +170,7 @@
                    try 
                    {
                        var line = lines[i];
                        if (!AssetSource.refdataFromEditor)
                        if (!isEditor)
                        { 
                            line = new string(line.Reverse().ToArray());
                        }
Assets/Editor/Tool/TableTool.cs
@@ -212,7 +212,7 @@
        foreach (var file in configFiles)
        {
            var fileInfo = new FileInfo(file.FullName);
            CopyTxt(fileInfo);
            CopyTxtBuild(fileInfo);
        }
    }
@@ -250,6 +250,24 @@
            Directory.CreateDirectory(configOutPutPath);
        }
        string filePath = configOutPutPath + "/" + fileName + ".txt";
        if (File.Exists(filePath))
        {
            File.Delete(filePath);
        }
        File.Copy(fileInfo.FullName, filePath);
    }
    private static void CopyTxtBuild(FileInfo fileInfo)
    {
        string fileName = fileInfo.Name.Split('.')[0];
        if (!Directory.Exists(configOutPutPath))
        {
            Directory.CreateDirectory(configOutPutPath);
        }
        string filePath = configOutPutPath + "/" + AssetVersionUtility.EncodeFileName(fileName) + ".txt";
        if (File.Exists(filePath))
        {
@@ -263,9 +281,9 @@
        else
        {
            //按行读取文件,并将每行内容倒序写入新文件
            using (StreamReader sr = new StreamReader(fileInfo.FullName, Encoding.Default))
            using (StreamReader sr = new StreamReader(fileInfo.FullName, Encoding.UTF8))
            {
                using (StreamWriter sw = new StreamWriter(filePath, false, Encoding.Default))
                using (StreamWriter sw = new StreamWriter(filePath, false, Encoding.UTF8))
                {
                    string line;
                    while ((line = sr.ReadLine()) != null)
@@ -274,7 +292,7 @@
                    }
                }
            }
        }
    }
@@ -295,7 +313,7 @@
                continue;
            }
            FileStream fileStream = _tableNameLst[i].fileInfo.OpenRead();
            StreamReader sr = new StreamReader(fileStream, Encoding.Default);
            StreamReader sr = new StreamReader(fileStream, Encoding.UTF8);
            CreateConfigClassFile.CreateConfigClass(_tableNameLst[i].fileInfo, isIL);
            sr.Dispose();
            sr.Close();
Assets/Launch/LoadDll.cs
@@ -58,7 +58,7 @@
        private string GetWebRequestPath(string asset)
        {
            var path = ResourcesModel.Instance.GetAssetFilePath(string.Concat(ResourcesModel.bytesFolderName, asset));
            var path = ResourcesModel.Instance.GetAssetFilePath(string.Concat(ResourcesModel.bytesFolderName, asset), false);
            if (!path.Contains("file:"))
            {
Assets/Launch/ResourcesModel.cs
@@ -269,9 +269,10 @@
        }
        public string GetAssetFilePath(string _assetKey)
        public string GetAssetFilePath(string _assetKey, bool reverse = true)
        {
            _assetKey = EncodeFileName(_assetKey);
            if (reverse)
                _assetKey = EncodeFileName(_assetKey);
            var path = Path.Combine(ExternalStorePath, _assetKey);
            if (!File.Exists(path))
            {