I wrote the c ++ code by referring to the link above.
As a result of debugging, function binding is not a problem However, LoadingScreen did not show on the screen.
This is my code.
void UEditorGameInstance::SetLoadingScreen(UUserWidget* NewLoadingWidget)
{
LoadingWidget = NewLoadingWidget;
}
void UEditorGameInstance::Init()
{
UGameInstance::Init();
FCoreUObjectDelegates::PreLoadMap.AddUObject(this, &UEditorGameInstance::BeginLoadingScreen);
FCoreUObjectDelegates::PostLoadMap.AddUObject(this, &UEditorGameInstance::EndLoadingScreen);
}
void UEditorGameInstance::BeginLoadingScreen(const FString& MapName)
{
FLoadingScreenAttributes LoadingScreen;
LoadingScreen.bAutoCompleteWhenLoadingCompletes = true;
if(LoadingWidget)
LoadingScreen.WidgetLoadingScreen = LoadingWidget->TakeWidget();
else
LoadingScreen.WidgetLoadingScreen = FLoadingScreenAttributes::NewTestLoadingScreenWidget();
GetMoviePlayer()->SetupLoadingScreen(LoadingScreen);
GetMoviePlayer()->PlayMovie();
}
The function of ‘SetLoadingScreen(UUserWidget*)’ is regist my LoadingScreen widget.
Where did I get it wrong? Am I misunderstanding? How to make LoadingScreen?