Skip to content

Commit

Permalink
修复MAC下编码Lua文件可执行文件路径。
Browse files Browse the repository at this point in the history
  • Loading branch information
jarjin2000 committed Jul 18, 2017
1 parent 0e43041 commit 091d149
Show file tree
Hide file tree
Showing 32 changed files with 14 additions and 6 deletions.
10 changes: 5 additions & 5 deletions Assets/LuaFramework/Editor/Packager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ public static void EncodeLuaFile(string srcFile, string outFile) {
File.Copy(srcFile, outFile, true);
return;
}
bool isWin = true;
bool isWin = true;
string luaexe = string.Empty;
string args = string.Empty;
string exedir = string.Empty;
Expand All @@ -279,17 +279,17 @@ public static void EncodeLuaFile(string srcFile, string outFile) {
exedir = AppDataPath.Replace("assets", "") + "LuaEncoder/luajit/";
} else if (Application.platform == RuntimePlatform.OSXEditor) {
isWin = false;
luaexe = "./luac";
args = "-o " + outFile + " " + srcFile;
exedir = AppDataPath.Replace("assets", "") + "LuaEncoder/luavm/";
luaexe = "./luajit";
args = "-b " + srcFile + " " + outFile;
exedir = AppDataPath.Replace("assets", "") + "LuaEncoder/luajit_mac/";
}
Directory.SetCurrentDirectory(exedir);
ProcessStartInfo info = new ProcessStartInfo();
info.FileName = luaexe;
info.Arguments = args;
info.WindowStyle = ProcessWindowStyle.Hidden;
info.ErrorDialog = true;
info.UseShellExecute = isWin;
info.ErrorDialog = true;
Util.Log(info.FileName + " " + info.Arguments);

Process pro = Process.Start(info);
Expand Down
6 changes: 5 additions & 1 deletion Assets/LuaFramework/ToLua/Editor/ToLuaMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static class ToLuaMenu
#if !UNITY_5 && !UNITY_2017
typeof(Motion), //很多平台只是空类
#endif
typeof(UnityEngine.CustomYieldInstruction),
//typeof(UnityEngine.CustomYieldInstruction),
typeof(UnityEngine.YieldInstruction), //无需导出的类
typeof(UnityEngine.WaitForEndOfFrame), //内部支持
typeof(UnityEngine.WaitForFixedUpdate),
Expand Down Expand Up @@ -1035,7 +1035,11 @@ static void CopyBuildBat(string path, string tempDir)
File.Copy(path + "/Luajit64/Build.bat", tempDir + "/Build.bat", true);
}
}
#if UNITY_5 || UNITY_2017
else if (EditorUserBuildSettings.activeBuildTarget == BuildTarget.iOS)
#else
else if (EditorUserBuildSettings.activeBuildTarget == BuildTarget.iPhone)
#endif
{
//Debug.Log("iOS默认用64位,32位自行考虑");
File.Copy(path + "/Luajit64/Build.bat", tempDir + "/Build.bat", true);
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Assets/LuaFramework/ToLua/Examples/10_Enum/AccessingEnum.unity
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Assets/LuaFramework/ToLua/Examples/14_Out/TestOut.unity
Binary file not shown.
Binary file not shown.
Binary file modified Assets/LuaFramework/ToLua/Examples/16_Int64/TestInt64.unity
Binary file not shown.
Binary file modified Assets/LuaFramework/ToLua/Examples/17_Inherit/Inherit.unity
Binary file not shown.
Binary file not shown.
Binary file modified Assets/LuaFramework/ToLua/Examples/19_cjson/testcjson.unity
Binary file not shown.
Binary file modified Assets/LuaFramework/ToLua/Examples/20_utf8/utf8.unity
Binary file not shown.
Binary file modified Assets/LuaFramework/ToLua/Examples/21_String/TestString.unity
Binary file not shown.
Binary file not shown.
Binary file modified Assets/LuaFramework/ToLua/Examples/23_List/UseList.unity
Binary file not shown.
Binary file modified Assets/LuaFramework/ToLua/Examples/24_Struct/Struct.unity
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 4 additions & 0 deletions ReadMe.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ XlsxToLua: https://github.com/zhangqi-ulua/XlsxToLua
UnityHello: https://github.com/woshihuo12/UnityHello
Excel配置:https://github.com/sy-yanghuan/proton

//-------------2017-07-18-------------
(1)修复部分BUG报错。
(2)修复MAC下编码Lua文件可执行文件路径。

//-------------2017-07-17-------------
(1)更新tolua#到1.0.7.343版

Expand Down

0 comments on commit 091d149

Please sign in to comment.