GF源码笔记

资源加载成功的回调是一个怎样的运行流程?

举一个源码中的栗子,定位到Assets/GameFramework/Scripts/Runtime/Config/ConfigComponent.cs这个文件,在其Awake()方法中有下面一段代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
protected override void Awake()
{
base.Awake();

m_ConfigManager = GameFrameworkEntry.GetModule<IConfigManager>();
if (m_ConfigManager == null)
{
Log.Fatal("Config manager is invalid.");
return;
}

m_ConfigManager.ReadDataSuccess += OnReadDataSuccess;
m_ConfigManager.ReadDataFailure += OnReadDataFailure;

if (m_EnableLoadConfigUpdateEvent)
{
m_ConfigManager.ReadDataUpdate += OnReadDataUpdate;
}

if (m_EnableLoadConfigDependencyAssetEvent)
{
m_ConfigManager.ReadDataDependencyAsset += OnReadDataDependencyAsset;
}
}
阅读更多

GF框架学习计划

学习GF源码以及Demo,在此基础上扩展延伸学习其他方面

Your browser is out-of-date!

Update your browser to view this website correctly.&npsb;Update my browser now

×