GameFramwork(二)创建GameEntry类 |
您所在的位置:网站首页 › idata官网进入 › GameFramwork(二)创建GameEntry类 |
这个脚本感觉像是获取GameFramework预制件上的各个组件来调用 using System.Collections; using System.Collections.Generic; using UnityEngine; public partial class GameEntry : MonoBehaviour { private void Start() { InitBuiltinComponents(); } } //------------------------------------------------------------ //------------------------------------------------------------ using UnityEngine; using UnityGameFramework.Runtime; /// /// 游戏入口。 /// public partial class GameEntry : MonoBehaviour { /// /// 获取游戏基础组件。 /// public static BaseComponent Base { get; private set; } /// /// 获取配置组件。 /// public static ConfigComponent Config { get; private set; } /// /// 获取数据结点组件。 /// public static DataNodeComponent DataNode { get; private set; } /// /// 获取数据表组件。 /// public static DataTableComponent DataTable { get; private set; } /// /// 获取调试组件。 /// public static DebuggerComponent Debugger { get; private set; } /// /// 获取下载组件。 /// public static DownloadComponent Download { get; private set; } /// /// 获取实体组件。 /// public static EntityComponent Entity { get; private set; } /// /// 获取事件组件。 /// public static EventComponent Event { get; private set; } /// /// 获取文件系统组件。 /// public static FileSystemComponent FileSystem { get; private set; } /// /// 获取有限状态机组件。 /// public static FsmComponent Fsm { get; private set; } /// /// 获取本地化组件。 /// public static LocalizationComponent Localization { get; private set; } /// /// 获取网络组件。 /// public static NetworkComponent Network { get; private set; } /// /// 获取对象池组件。 /// public static ObjectPoolComponent ObjectPool { get; private set; } /// /// 获取流程组件。 /// public static ProcedureComponent Procedure { get; private set; } /// /// 获取资源组件。 /// public static ResourceComponent Resource { get; private set; } /// /// 获取场景组件。 /// public static SceneComponent Scene { get; private set; } /// /// 获取配置组件。 /// public static SettingComponent Setting { get; private set; } /// /// 获取声音组件。 /// public static SoundComponent Sound { get; private set; } /// /// 获取界面组件。 /// public static UIComponent UI { get; private set; } /// /// 获取网络组件。 /// public static WebRequestComponent WebRequest { get; private set; } private static void InitBuiltinComponents() { Base = UnityGameFramework.Runtime.GameEntry.GetComponent(); Config = UnityGameFramework.Runtime.GameEntry.GetComponent(); DataNode = UnityGameFramework.Runtime.GameEntry.GetComponent(); DataTable = UnityGameFramework.Runtime.GameEntry.GetComponent(); Debugger = UnityGameFramework.Runtime.GameEntry.GetComponent(); Download = UnityGameFramework.Runtime.GameEntry.GetComponent(); Entity = UnityGameFramework.Runtime.GameEntry.GetComponent(); Event = UnityGameFramework.Runtime.GameEntry.GetComponent(); FileSystem = UnityGameFramework.Runtime.GameEntry.GetComponent(); Fsm = UnityGameFramework.Runtime.GameEntry.GetComponent(); Localization = UnityGameFramework.Runtime.GameEntry.GetComponent(); Network = UnityGameFramework.Runtime.GameEntry.GetComponent(); ObjectPool = UnityGameFramework.Runtime.GameEntry.GetComponent(); Procedure = UnityGameFramework.Runtime.GameEntry.GetComponent(); Resource = UnityGameFramework.Runtime.GameEntry.GetComponent(); Scene = UnityGameFramework.Runtime.GameEntry.GetComponent(); Setting = UnityGameFramework.Runtime.GameEntry.GetComponent(); Sound = UnityGameFramework.Runtime.GameEntry.GetComponent(); UI = UnityGameFramework.Runtime.GameEntry.GetComponent(); WebRequest = UnityGameFramework.Runtime.GameEntry.GetComponent(); } } //-----------------------------------------------------------------------------------------------------// 然后运行就OK了 |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |