void AShooterPlayerController::GameHasEnded(class AActor *EndGameFocus, bool bIsWinner)
{
Super::GameHasEnded(EndGameFocus, bIsWinner);
HUD->RemoveFromViewport();
if (bIsWinner)
{
UUserWidget* WinScreen = CreateWidget(this, WinScreenClass);
if (WinScreen != nullptr)
{
WinScreen->AddToViewport();
}
}
else
{
UUserWidget* LoseScreen = CreateWidget(this, LoseScreenClass);
if (LoseScreen != nullptr)
{
LoseScreen->AddToViewport();
}
}
UE_LOG(LogTemp, Warning, TEXT("End"));
GetWorldTimerManager().SetTimer(RestartTimer, this, &APlayerController::RestartLevel, RestartDelay);
}
[18/36] Compile [x64] ShooterPlayerController.cpp
D:\unreal\Unreal Projects\SimpleShooter\Source\SimpleShooter\ShooterPlayerController.cpp(24): warning C4996: ‘UUserWidget::RemoveFromViewport’: RemoveFromViewport is deprecated. Use RemoveFromParent instead. Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.
[19/36] Compile [x64] BTTask_Shoot.gen.cpp
It’s a log