You've already forked LuckyWorld
Optimize code to unreal style
This commit is contained in:
@ -2,16 +2,13 @@
|
||||
|
||||
|
||||
#include "UI/GameUserWidget.h"
|
||||
#include "FunctionLibraries/LuckyRobotsFunctionLibrary.h"
|
||||
#include "Core/LuckyRobotsGameInstance.h"
|
||||
|
||||
void UGameUserWidget::NativeConstruct()
|
||||
{
|
||||
Super::NativeConstruct();
|
||||
|
||||
ULuckyRobotsGameInstance* LuckyRobotsGameInstance = ULuckyRobotsFunctionLibrary::GetLuckyRobotsGameInstance(this);
|
||||
if (LuckyRobotsGameInstance)
|
||||
if (ULuckyRobotsGameInstance* GameInstance = Cast<ULuckyRobotsGameInstance>(GetGameInstance()))
|
||||
{
|
||||
LuckyRobotsGameInstance->GameUserWidget = this;
|
||||
GameInstance->GameUserWidget = this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user