UE4如何解析命令行参数

UE4如何解析命令行参数

// 获取命令行
const TCHAR* CmdLine = ::GetCommandLine();
// 获取命令行参数
const TCHAR* CmdLineParam = FCommandLine::Get();


// CommandLind : D:\_SVNTmp\Projects\WindowsNoEditor\VRS\Binaries\Win64\VRS-Win64-DebugGame.exe -Language=ch
// ch:中文 en:英文
// -Language=ch  -Language=en
FString param;
FParse::Value(FCommandLine::Get(), TEXT("-Language="), param);
if (param == "ch")
{
	UE_LOG(VRSLog, Warning, TEXT("中文"));
}
if (param == "en")
{
	UE_LOG(VRSLog, Warning, TEXT("英文"));
}

你可能感兴趣的:(UE4学习笔记,UE4_API)