Initial Commit - Lesson 31 (Commit #1)
This commit is contained in:
19
Source/FPSTemplate/Private/UI/ShooterHUD.cpp
Normal file
19
Source/FPSTemplate/Private/UI/ShooterHUD.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "UI/ShooterHUD.h"
|
||||
|
||||
#include "Blueprint/UserWidget.h"
|
||||
|
||||
|
||||
void AShooterHUD::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
|
||||
APlayerController* PlayerController = GetOwningPlayerController();
|
||||
if (IsValid(PlayerController) && ShooterOverlayClass)
|
||||
{
|
||||
Overlay = CreateWidget<UUserWidget>(PlayerController, ShooterOverlayClass);
|
||||
Overlay->AddToViewport();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user