GameMain.Builtin.cs 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityGameFramework.Runtime;
  5. public partial class GameMain : MonoBehaviour
  6. {
  7. /// <summary>
  8. /// 获取游戏基础组件。
  9. /// </summary>
  10. public static BaseComponent Base
  11. {
  12. get;
  13. private set;
  14. }
  15. /// <summary>
  16. /// 获取配置组件。
  17. /// </summary>
  18. public static ConfigComponent Config
  19. {
  20. get;
  21. private set;
  22. }
  23. /// <summary>
  24. /// 获取数据结点组件。
  25. /// </summary>
  26. public static DataNodeComponent DataNode
  27. {
  28. get;
  29. private set;
  30. }
  31. /// <summary>
  32. /// 获取数据表组件。
  33. /// </summary>
  34. public static DataTableComponent DataTable
  35. {
  36. get;
  37. private set;
  38. }
  39. /// <summary>
  40. /// 获取调试组件。
  41. /// </summary>
  42. public static DebuggerComponent Debugger
  43. {
  44. get;
  45. private set;
  46. }
  47. /// <summary>
  48. /// 获取下载组件。
  49. /// </summary>
  50. public static DownloadComponent Download
  51. {
  52. get;
  53. private set;
  54. }
  55. /// <summary>
  56. /// 获取实体组件。
  57. /// </summary>
  58. public static EntityComponent Entity
  59. {
  60. get;
  61. private set;
  62. }
  63. /// <summary>
  64. /// 获取事件组件。
  65. /// </summary>
  66. public static EventComponent Event
  67. {
  68. get;
  69. private set;
  70. }
  71. /// <summary>
  72. /// 获取文件系统组件。
  73. /// </summary>
  74. public static FileSystemComponent FileSystem
  75. {
  76. get;
  77. private set;
  78. }
  79. /// <summary>
  80. /// 获取有限状态机组件。
  81. /// </summary>
  82. public static FsmComponent Fsm
  83. {
  84. get;
  85. private set;
  86. }
  87. /// <summary>
  88. /// 获取本地化组件。
  89. /// </summary>
  90. public static LocalizationComponent Localization
  91. {
  92. get;
  93. private set;
  94. }
  95. /// <summary>
  96. /// 获取网络组件。
  97. /// </summary>
  98. public static NetworkComponent Network
  99. {
  100. get;
  101. private set;
  102. }
  103. /// <summary>
  104. /// 获取对象池组件。
  105. /// </summary>
  106. public static ObjectPoolComponent ObjectPool
  107. {
  108. get;
  109. private set;
  110. }
  111. /// <summary>
  112. /// 获取流程组件。
  113. /// </summary>
  114. public static ProcedureComponent Procedure
  115. {
  116. get;
  117. private set;
  118. }
  119. /// <summary>
  120. /// 获取资源组件。
  121. /// </summary>
  122. public static ResourceComponent Resource
  123. {
  124. get;
  125. private set;
  126. }
  127. /// <summary>
  128. /// 获取场景组件。
  129. /// </summary>
  130. public static SceneComponent Scene
  131. {
  132. get;
  133. private set;
  134. }
  135. /// <summary>
  136. /// 获取配置组件。
  137. /// </summary>
  138. public static SettingComponent Setting
  139. {
  140. get;
  141. private set;
  142. }
  143. /// <summary>
  144. /// 获取声音组件。
  145. /// </summary>
  146. public static SoundComponent Sound
  147. {
  148. get;
  149. private set;
  150. }
  151. /// <summary>
  152. /// 获取界面组件。
  153. /// </summary>
  154. public static UIComponent UI
  155. {
  156. get;
  157. private set;
  158. }
  159. /// <summary>
  160. /// 获取网络组件。
  161. /// </summary>
  162. public static WebRequestComponent WebRequest
  163. {
  164. get;
  165. private set;
  166. }
  167. private void InitBuiltinComponents()
  168. {
  169. Base = UnityGameFramework.Runtime.GameEntry.GetComponent<BaseComponent>();
  170. Config = UnityGameFramework.Runtime.GameEntry.GetComponent<ConfigComponent>();
  171. DataNode = UnityGameFramework.Runtime.GameEntry.GetComponent<DataNodeComponent>();
  172. DataTable = UnityGameFramework.Runtime.GameEntry.GetComponent<DataTableComponent>();
  173. Debugger = UnityGameFramework.Runtime.GameEntry.GetComponent<DebuggerComponent>();
  174. Download = UnityGameFramework.Runtime.GameEntry.GetComponent<DownloadComponent>();
  175. Entity = UnityGameFramework.Runtime.GameEntry.GetComponent<EntityComponent>();
  176. Event = UnityGameFramework.Runtime.GameEntry.GetComponent<EventComponent>();
  177. FileSystem = UnityGameFramework.Runtime.GameEntry.GetComponent<FileSystemComponent>();
  178. Fsm = UnityGameFramework.Runtime.GameEntry.GetComponent<FsmComponent>();
  179. Localization = UnityGameFramework.Runtime.GameEntry.GetComponent<LocalizationComponent>();
  180. Network = UnityGameFramework.Runtime.GameEntry.GetComponent<NetworkComponent>();
  181. ObjectPool = UnityGameFramework.Runtime.GameEntry.GetComponent<ObjectPoolComponent>();
  182. Procedure = UnityGameFramework.Runtime.GameEntry.GetComponent<ProcedureComponent>();
  183. Resource = UnityGameFramework.Runtime.GameEntry.GetComponent<ResourceComponent>();
  184. Scene = UnityGameFramework.Runtime.GameEntry.GetComponent<SceneComponent>();
  185. Setting = UnityGameFramework.Runtime.GameEntry.GetComponent<SettingComponent>();
  186. Sound = UnityGameFramework.Runtime.GameEntry.GetComponent<SoundComponent>();
  187. UI = UnityGameFramework.Runtime.GameEntry.GetComponent<UIComponent>();
  188. WebRequest = UnityGameFramework.Runtime.GameEntry.GetComponent<WebRequestComponent>();
  189. }
  190. }