UE Snap03 启动参数设置
UE打包后传入自定义参数及解析。
void UGameInstance::StartGameInstance()
{
Super::StartGameInstance();
UE_LOG(LogTemp, Warning, TEXT("--StartGameInstance--"));
FString param;
FParse::Value(FCommandLine::Get(), TEXT("-UserName="), param);
UE_LOG(LogTemp, Warning,TEXT("UserName=%s"), *param);
if (!param.IsEmpty()) {
this.UserName = param;
}
}
示例:myUEpackedgame.exe -UserName=wblong
参考
- https://blog.csdn.net/mrbaolong/article/details/136920472?spm=1001.2014.3001.5502