You've already forked LuckyWorld
Optimize some gameinstance codes
This commit is contained in:
17
Source/Luckyrobots/Private/GameUserWidget.cpp
Normal file
17
Source/Luckyrobots/Private/GameUserWidget.cpp
Normal file
@ -0,0 +1,17 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "GameUserWidget.h"
|
||||
#include "LuckyRobotsFunctionLibrary.h"
|
||||
#include "LuckyRobotsGameInstance.h"
|
||||
|
||||
void UGameUserWidget::NativeConstruct()
|
||||
{
|
||||
Super::NativeConstruct();
|
||||
|
||||
ULuckyRobotsGameInstance* LuckyRobotsGameInstance = ULuckyRobotsFunctionLibrary::GetLuckyRobotsGameInstance(this);
|
||||
if (LuckyRobotsGameInstance)
|
||||
{
|
||||
LuckyRobotsGameInstance->GameUserWidget = this;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user