==============
Mac 执行 Shell 脚本使用
public static void FunctionA()
{
#if UNITY_EDITOR_WIN
string filePath = Application.dataPath + "/../../aaa.bat";
System.Diagnostics.Process proc = System.Diagnostics.Process.Start(filePath);
#elif UNITY_EDITOR_OSX
string filePath = Application.dataPath + "/../../aaa.sh";
System.Diagnostics.Process proc = System.Diagnostics.Process.Start("/bin/bash", filePath);
#endif
proc.WaitForExit();
}
public static class ClassA
{
#if UNITY_EDITOR_WIN
public static string DOTNET_CMD = "dotnet";
#elif UNITY_EDITOR_OSX
public static string DOTNET_CMD = "/usr/local/share/dotnet/dotnet";
#else
public static string DOTNET_CMD = "dotnet";
#endif
}
public static void FunctionB()
{
var cwd = Path.GetFullPath(Application.dataPath + "/../../Path");
Process.Start(cwd, EditorCommand.DOTNET_CMD, "run -c Release");
}