Tag: unity3d monodevelop

是否可以在OSX上以Mono或.NET从Unity C#运行R代码?

有没有办法在Mono中使用Unity的C#运行R脚本? 如果没有办法使用Mono运行R脚本,我愿意使用.NET 更新 因此,以下代码将调用R脚本,但如果从unity monodevelop调用则不会输出文件。 将字符串返回到mono是可以的,但是在startInfo.UseShellExecute和startInfo.RedirectStandardOutput上更改true和false会引发错误。 以下是将调用R代码的C#代码: System.Diagnostics.Process process = new System.Diagnostics.Process(); System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo(); startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; startInfo.FileName = “Rscript”; startInfo.WorkingDirectory = Application.dataPath + “/myUnity/Scripts/”; startInfo.Arguments = “Rexp1.R”; startInfo.CreateNoWindow = true; startInfo.WindowStyle = ProcessWindowStyle.Hidden; startInfo.UseShellExecute = true; startInfo.RedirectStandardOutput = false; process.StartInfo = startInfo; process.Start(); 我确信R脚本会输出一个文件,或者我可以抓住stdout并保持它。 我将很高兴输出到文件或具有统一允许返回的字符串是R脚本的输出。 更新2 * – 这是R脚本。 sink(“output.txt”) nts […]

如何使脚本以统一的简单方式等待/睡眠

如何在TextUI.text = ….之间TextUI.text = ….一个sleep函数,在每个短语之间等待3秒? public Text GuessUI; public Text TextUI; […truncated…] TextUI.text = “Welcome to Number Wizard!”; TextUI.text = (“The highest number you can pick is ” + max); TextUI.text = (“The lowest number you can pick is ” + min); 我已经尝试了各种各样的东西,但没有奏效,这样: TextUI.text = “Welcome to Number Wizard!”; yield WaitForSeconds (3); TextUI.text = (“The […]