少年修仙传客户端基础资源
client_Wu Xijin
2019-01-16 d53a782e2fd91ffc47dad0dd5a080ee451a351b7
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
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.IO;
 
public class LuaBuildHelper
{
    public static void OnPreBuild()
    {
        var path = ResourcesPath.LUA_FODLER;
        var fileInfos = new List<FileInfo>();
        FileExtersion.GetAllDirectoryFileInfos(ResourcesPath.LUA_FODLER, fileInfos);
 
        foreach (var item in fileInfos)
        {
            var from = item.FullName;
            var extension = Path.GetExtension(from);
            if (extension == ".lua")
            {
                var to = Path.ChangeExtension(from, ".txt");
                File.Copy(from, to, true);
            }
        }
 
        AssetDatabase.SaveAssets();
        AssetDatabase.Refresh();
    }
 
    public static void OnPostBuild()
    {
        var path = ResourcesPath.LUA_FODLER;
        var fileInfos = new List<FileInfo>();
        FileExtersion.GetAllDirectoryFileInfos(ResourcesPath.LUA_FODLER, fileInfos);
 
        foreach (var item in fileInfos)
        {
            var file = item.FullName;
            var extension = Path.GetExtension(file);
            if (extension == ".txt")
            {
                File.Delete(file);
            }
        }
    }
 
}