Skip to content

Instantly share code, notes, and snippets.

@Tunied
Created December 10, 2022 14:14
Show Gist options
  • Save Tunied/6250c1800f198b287bc4ae04d37995e7 to your computer and use it in GitHub Desktop.
Save Tunied/6250c1800f198b287bc4ae04d37995e7 to your computer and use it in GitHub Desktop.
Load给定后缀的所有文件
var rootPath = EMG_FileUtils.PersistentDataPath + $"/{ProjectName}/Script";
if (!Directory.Exists(rootPath))
{
Directory.CreateDirectory(rootPath);
}
var allFilePath = Directory.GetFiles(rootPath, "*.lua");
foreach (var filePath in allFilePath)
{
var info = new FileInfo(filePath);
var fileStr = File.ReadAllText(filePath);
CELog.Log($"加载文件 {info.Name} ");
CELog.Log(fileStr);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment