InitBuiltinComponents:初始化框架自带的基础组件;
InitCustomComponents:初始化我们自己的组件。
(另外一提,GameEntry类拆分为三个文件了,别以为只有上面那一点点代码)
2.InitBuiltinComponents
我重点要说的是InitBuiltinComponents,这个函数里对框架的所有基础组件进行了初始化,具体如何初始化的,不在本篇文章的范围内(旁白:当然了,因为他自己也不懂)
什么?你们非要我贴代码凑字数?好吧好吧,这个函数长这样:
private static void InitBuiltinComponents()
{
Base = UnityGameFramework.Runtime.GameEntry.GetComponent<BaseComponent>();
DataNode = UnityGameFramework.Runtime.GameEntry.GetComponent<DataNodeComponent>();
DataTable = UnityGameFramework.Runtime.GameEntry.GetComponent<DataTableComponent>();
Debugger = UnityGameFramework.Runtime.GameEntry.GetComponent<DebuggerComponent>();
Download = UnityGameFramework.Runtime.GameEntry.GetComponent<DownloadComponent>();
Entity = UnityGameFramework.Runtime.GameEntry.GetComponent<EntityComponent>();
Event = UnityGameFramework.Runtime.GameEntry.GetComponent<EventComponent>();
Fsm = UnityGameFramework.Runtime.GameEntry.GetComponent<FsmComponent>();
Localization = UnityGameFramework.Runtime.GameEntry.GetComponent<LocalizationComponent>();
Network = UnityGameFramework.Runtime.GameEntry.GetComponent<NetworkComponent>();
ObjectPool = UnityGameFramework.Runtime.GameEntry.GetComponent<ObjectPoolComponent>();
Procedure = UnityGameFramework.Runtime.GameEntry.GetComponent<ProcedureComponent>();
Resource = UnityGameFramework.Runtime.GameEntry.GetComponent<ResourceComponent>();
Scene = UnityGameFramework.Runtime.GameEntry.GetComponent<SceneComponent>();
Setting = UnityGameFramework.Runtime.GameEntry.GetComponent<SettingComponent>();
Sound = UnityGameFramework.Runtime.GameEntry.GetComponent<SoundComponent>();
UI = UnityGameFramework.Runtime.GameEntry.GetComponent<UIComponent>();
WebRequest = UnityGameFramework.Runtime.GameEntry.GetComponent<WebRequestComponent>();
}
3.真正的入口