public static void CompileLua(string dllName, string dllDir, string outDirName, List <string> referencedLuaAssemblies, bool isModule) { LuaCompiler.Compile(dllName, dllDir, outDirName, referencedLuaAssemblies, isModule); FileHelper.ReplaceExtensionName(LuaCompiler.outDir + outDirName, LuaExtensionName, LuaTxtExtensionName); ABNameEditor.SetFolderLuaABName(LuaCompiler.outDir + outDirName); AssetDatabase.Refresh(); }
public static bool CopyDll(string dllName) { var result = FileHelper.CopyFile(Path.Combine(ScriptAssembliesDir, $"{dllName}.dll"), Path.Combine(CodeDir, $"{dllName}.dll.bytes"), true); FileHelper.CopyFile(Path.Combine(ScriptAssembliesDir, $"{dllName}.pdb"), Path.Combine(CodeDir, $"{dllName}.pdb.bytes"), true); if (result) { Log.Info($"复制{dllName}.dll, {dllName}.pdb到Res/Code完成"); AssetDatabase.Refresh(); } return(result); }
public static void Geanerate() { Log.Debug("=========开始转换C#为lua,请耐心等待========="); FileHelper.CleanDirectory("Assets/Bundles/Lua/Hotfix"); FileHelper.CleanDirectory("Assets/Bundles/Lua/HotfixView"); FileHelper.CleanDirectory("Assets/Bundles/Lua/Model"); FileHelper.CleanDirectory("Assets/Bundles/Lua/ModelView"); FileHelper.CleanDirectory("Assets/Res/Code"); GenModel.Gen(); GenHotfixView.Gen(); GenModelView.Gen(); GenHotfix.Gen(); AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); Log.Debug("===============转换完成==============="); }
//[MenuItem("Tools/Lua/Replace the all \".lua.txt\" file of the selected folder with \".lua\"")] public static void ReplaceSelectedFolder() { var assetGUIDs = Selection.assetGUIDs; foreach (var guid in assetGUIDs) { var assetPath = AssetDatabase.GUIDToAssetPath(guid); if (Directory.Exists(assetPath)) { var outDirName = assetPath.Substring(assetPath.LastIndexOf("/") + 1); FileHelper.ReplaceExtensionName(LuaCompiler.outDir + outDirName, LuaTxtExtensionName, LuaExtensionName); } } AssetDatabase.Refresh(); }