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);
|
}
|
}
|
}
|
|
}
|