Unityからコマンドプロンプトを起動するスクリプト.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEditor; | |
public static class CMD | |
{ | |
[MenuItem("CMD/Debug/EchoTEST")] | |
public static void EchoTEST() | |
{ | |
Call("/k echo TEST", false); | |
} | |
private static void Call(string cmd, bool isHide = true) | |
{ | |
System.Diagnostics.Process process = new System.Diagnostics.Process(); | |
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo(); | |
if(isHide) startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; | |
startInfo.FileName = "cmd.exe"; | |
startInfo.Arguments = cmd; | |
process.StartInfo = startInfo; | |
process.Start(); | |
process.WaitForExit(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment