54 lines
1.1 KiB
C++
54 lines
1.1 KiB
C++
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
|
|
#include "ShooterPlayerController.h"
|
|
|
|
#include "Blueprint/UserWidget.h"
|
|
|
|
AShooterPlayerController::AShooterPlayerController()
|
|
{
|
|
}
|
|
|
|
void AShooterPlayerController::BeginPlay()
|
|
{
|
|
Super::BeginPlay();
|
|
|
|
// Check our HUD Overlay TSubclassOf variable
|
|
if (HUDOverlayClass)
|
|
{
|
|
HUDOverlay = CreateWidget<UUserWidget>(this, HUDOverlayClass);
|
|
|
|
if (HUDOverlay)
|
|
{
|
|
HUDOverlay->AddToViewport();
|
|
HUDOverlay->SetVisibility(ESlateVisibility::Hidden);
|
|
}
|
|
}
|
|
}
|
|
|
|
void AShooterPlayerController::GameHasEnded(AActor* EndGameFocus, bool bIsWinner)
|
|
{
|
|
Super::GameHasEnded(EndGameFocus, bIsWinner);
|
|
HUDOverlay->RemoveFromParent();
|
|
|
|
/*if (bIsWinner)
|
|
{
|
|
UUserWidget* WinScreen = CreateWidget(this, WinScreenClass);
|
|
if (WinScreen != nullptr)
|
|
{
|
|
WinScreen->AddToViewport();
|
|
}
|
|
}
|
|
else
|
|
{
|
|
UUserWidget* LoseScreen = CreateWidget(this, LoseScreenClass);
|
|
if (LoseScreen != nullptr)
|
|
{
|
|
LoseScreen->AddToViewport();
|
|
}
|
|
}
|
|
|
|
GetWorldTimerManager().SetTimer(RestartTimer, this, &APlayerController::RestartLevel, RestartDelay);*/
|
|
}
|
|
|