using UnityEngine;
using System.Collections;
using System;
using UnityEngine.UI;
using System.Linq;
public class CmdTest : MonoBehaviour {
public Text text1;
public Text text2;
// Use this for initialization
void Start()
{
string CommandLine = Environment.CommandLine;
string[] CommandLineArgs = Environment.GetCommandLineArgs();
text1.text = "CommandLine : " + CommandLine;
text2.text = CommandLineArgs.Aggregate<string, string>(
"CommandLineArgs : ",
(a, b) => a + " , " + b);
}
}
编辑器下:
打包PC下(直接启动):
打包PC下(命令行启动):