void APlayerController::GetViewportSize(int32& SizeX, int32& SizeY) const
{
SizeX = 0;
SizeY = 0;
ULocalPlayer* LocPlayer = Cast<ULocalPlayer>(Player);
if( LocPlayer && LocPlayer->ViewportClient )
{
FVector2D ViewportSize;
LocPlayer->ViewportClient->GetViewportSize(ViewportSize);
SizeX = ViewportSize.X;
SizeY = ViewportSize.Y;
}
}
游戏启动后需要延迟0.2s调用