三国卡牌客户端基础资源仓库
hch
2025-09-15 ea3ad185fcbccce1bd49d467de7186ac08edab24
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using UnityEditor;
using UnityEngine;
 
public class TableTool : EditorWindow
{
 
    public static string configOutPutPath;
 
 
    
    public static void CopyConfigsToOutPutPath(string _outPath)
    {
        configOutPutPath = _outPath;
        var root1 = UnityEngine.Application.dataPath + "/ResourcesOut/Config";
        var configFiles = new List<FileInfo>();
        configFiles.AddRange(FileExtersion.GetFileInfos(root1, new string[] { "*.txt", "*.TXT" }));
        var root2 = UnityEngine.Application.dataPath + "/Resources/Config";
        if (Directory.Exists(root2))
        {
            var fileInfos = FileExtersion.GetFileInfos(root2, new string[] { "*.txt", "*.TXT" });
            if (fileInfos != null)
            {
                configFiles.AddRange(fileInfos);
            }
        }
 
        foreach (var file in configFiles)
        {
            var fileInfo = new FileInfo(file.FullName);
 
            CopyTxt(fileInfo);
        }
    }
 
    
    private static void CopyTxt(FileInfo fileInfo)
    {
        string fileName = fileInfo.Name.Split('.')[0];
 
        if (!Directory.Exists(configOutPutPath))
        {
            Directory.CreateDirectory(configOutPutPath);
        }
 
        string filePath = configOutPutPath + "/" + fileName + ".txt";
        if (File.Exists(filePath))
        {
            File.Delete(filePath);
        }
 
        File.Copy(fileInfo.FullName, filePath);
    }
 
    
 
 
}