您应该能够使用以下系统获取应用程序命令行参数.环境命令行(&N);系统环境命令行args:
string[] args = System.Environment.GetCommandLineArgs();
int widthInput;
int heightInput;
for (int i = 0; i < args.Length; i++)
{
Debug.Log("ARG " + i + ": " + args[i]);
if (args[i] == "-screen-width")
{
int.TryParse(args[i+1], out widthInput);
} else if(args[i] == "-screen-height") {
int.TryParse(args[i+1], out heightInput);
}
}
if(heightInput != null && widthInput!=null)
Screen.SetResolution(heightInput , widthInput, false);
下面是重新调整的源代码链接,以满足您的需要:https://answers.unity.com/questions/138715/read-command-line-arguments.html
希望这有帮助!