unitysamples / LyraStarterGame /Plugins /CommonLoadingScreen /Source /CommonStartupLoadingScreen /Private /CommonStartupLoadingScreen.cpp
Download LyraStarterGame/Plugins/CommonLoadingScreen/Source/CommonStartupLoadingScreen/Private/CommonStartupLoadingScreen.cpp from Alexhas2/unitysamples: direct link, hf CLI and curl.
- Browser
- Download file 1.71 kB
-
https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Plugins/CommonLoadingScreen/Source/CommonStartupLoadingScreen/Private/CommonStartupLoadingScreen.cpp
- Command line
-
hf download hf://datasets/Alexhas2/unitysamples/LyraStarterGame/Plugins/CommonLoadingScreen/Source/CommonStartupLoadingScreen/Private/CommonStartupLoadingScreen.cpp
-
curl -L -o CommonStartupLoadingScreen.cpp https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Plugins/CommonLoadingScreen/Source/CommonStartupLoadingScreen/Private/CommonStartupLoadingScreen.cpp
1.71 kB
| // Copyright Epic Games, Inc. All Rights Reserved. | |
| class FCommonStartupLoadingScreenModule : public IModuleInterface | |
| { | |
| public: | |
| /** IModuleInterface implementation */ | |
| virtual void StartupModule() override; | |
| virtual void ShutdownModule() override; | |
| bool IsGameModule() const override; | |
| private: | |
| void OnPreLoadScreenManagerCleanUp(); | |
| TSharedPtr<FCommonPreLoadScreen> PreLoadingScreen; | |
| }; | |
| void FCommonStartupLoadingScreenModule::StartupModule() | |
| { | |
| // No need to load these assets on dedicated servers. | |
| // Still want to load them in commandlets so cook catches them | |
| if (!IsRunningDedicatedServer()) | |
| { | |
| PreLoadingScreen = MakeShared<FCommonPreLoadScreen>(); | |
| PreLoadingScreen->Init(); | |
| if (!GIsEditor && FApp::CanEverRender() && FPreLoadScreenManager::Get()) | |
| { | |
| FPreLoadScreenManager::Get()->RegisterPreLoadScreen(PreLoadingScreen); | |
| FPreLoadScreenManager::Get()->OnPreLoadScreenManagerCleanUp.AddRaw(this, &FCommonStartupLoadingScreenModule::OnPreLoadScreenManagerCleanUp); | |
| } | |
| } | |
| } | |
| void FCommonStartupLoadingScreenModule::OnPreLoadScreenManagerCleanUp() | |
| { | |
| //Once the PreLoadScreenManager is cleaning up, we can get rid of all our resources too | |
| PreLoadingScreen.Reset(); | |
| ShutdownModule(); | |
| } | |
| void FCommonStartupLoadingScreenModule::ShutdownModule() | |
| { | |
| } | |
| bool FCommonStartupLoadingScreenModule::IsGameModule() const | |
| { | |
| return true; | |
| } | |
| IMPLEMENT_MODULE(FCommonStartupLoadingScreenModule, CommonStartupLoadingScreen) | |