Command Line
December 22, 2022Less than 1 minute
Command Line
读取启动命令行命令
FString ParameterValue;
if (FParse::Value(FCommandLine::Get(), TEXT("-LocalClientIndex="), ParameterValue))
{
LocalUserIndex = FCString::Atoi((*ParameterValue));
UE_LOG(LogBalor, Log, TEXT("Command Line LocalUserIndex@@@@@@: %s "), *ParameterValue);
}
控制台命令行调用
直接在方法属性中添加Exec
即可,在控制台直接使用函数名调用。
UFUNCTION( Exec )
void Test(const FString TestStr)
多人模式下,服务器可以直接使用函数名调用,客户端需要在函数名前加上ServerExec
来调用。