mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 10:34:30 +08:00
refactor(core): 调整资源注册时机
- 将资源注册逻辑移至架构初始化事件监听器内部 - 确保资源在系统完全初始化后再进行注册 - 优化资源预加载流程的执行顺序
This commit is contained in:
parent
a444581ec7
commit
77065b6c17
@ -26,11 +26,11 @@ public abstract class AbstractResourceFactorySystem : AbstractSystem, IResourceF
|
||||
_registry = new ResourceFactory.Registry();
|
||||
_resourceLoadSystem = this.GetSystem<IResourceLoadSystem>();
|
||||
_assetCatalogSystem = this.GetSystem<IAssetCatalogSystem>();
|
||||
// 注册资源
|
||||
RegisterResources();
|
||||
// 监听架构初始化事件
|
||||
this.RegisterEvent<ArchitectureEvents.ArchitectureInitializedEvent>(_ =>
|
||||
{
|
||||
// 注册资源
|
||||
RegisterResources();
|
||||
// 预加载所有资源
|
||||
_registry.PreloadAll();
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user