Files
BlueRoseNote/03-UnrealEngine/Gameplay/Lyra/UE5 Lyra学习笔记(7)—CommonLoadingScreen.md

35 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Untitled
date: 2025-07-25 14:49:41
excerpt:
tags:
rating: ⭐
---
# 相关CVar参数
- CommonLoadingScreen.AlwaysShow总是显示
- CommonLoadingScreen.LogLoadingScreenReasonEveryFrame
- CommonLoadingScreen.HoldLoadingScreenAdditionalSecs载入完成后的等待时间。
# 相关逻辑
- ***ULoadingScreenManager***:核心逻辑。
- UCommonLoadingScreenSettings各种设置参数。
- ULoadingProcessTask继承ILoadingProcessInterface接口只需覆盖ShouldShowLoadingScreen()。
- FCommonStartupLoadingScreenModuleStartupModule()、FPreLoadScreenManager::OnPreLoadScreenManagerCleanUp()绑定OnPreLoadScreenManagerCleanUp()。
- SCommonPreLoadingScreenWidgetLoadingScreen Slate控件。
## ULoadingScreenManager(UGameInstanceSubsystem)
- Initialize()绑定PreLoadMapWithContext与PostLoadMapWithWorld委托。
- Deinitialize()移除BlockInput、移除Widget、移除委托、关闭Tickable。
- ShouldCreateSubsystem()覆盖接口函数对于非Server端都会加载LoadingScreen。
- FTickableGameObject
- Tick():调用**ShouldCreateSubsystem()**计算TimeUntilNextLogHeartbeatSeconds。
- GetTickableTickType()
- IsTickable()如果GameInstance有效且拥有游戏窗口就可以进行Tick。
- GetStatId()STATGROUP_Tickables
- GetTickableGameObjectWorld()GetGameInstance()->GetWorld();
- RegisterLoadingProcessor()用于坐车任务在ULoadingProcessTask::CreateLoadingScreenProcessTask()被调用。
- UnregisterLoadingProcessor()用于卸载任务在ULoadingProcessTask::Unregister()被调用。
- **HandlePreLoadMap()**修改bCurrentlyInLoadMap为true之后调用UpdateLoadingScreen()。
- **HandlePostLoadMap()**修改bCurrentlyInLoadMap为false。
### FPreLoadScreenManager