init
This commit is contained in:
@@ -0,0 +1,138 @@
|
||||
//------------------------------------------------------------
|
||||
// Game Framework
|
||||
// Copyright © 2013-2021 Jiang Yin. All rights reserved.
|
||||
// Homepage: https://gameframework.cn/
|
||||
// Feedback: mailto:ellan@gameframework.cn
|
||||
//------------------------------------------------------------
|
||||
|
||||
using UnityGameFramework.Runtime;
|
||||
|
||||
/// <summary>
|
||||
/// 游戏入口。
|
||||
/// </summary>
|
||||
public partial class GameEntry
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取游戏基础组件。
|
||||
/// </summary>
|
||||
public static BaseComponent Base { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取配置组件。
|
||||
/// </summary>
|
||||
public static ConfigComponent Config { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取数据结点组件。
|
||||
/// </summary>
|
||||
public static DataNodeComponent DataNode { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取数据表组件。
|
||||
/// </summary>
|
||||
public static DataTableComponent DataTable { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取调试组件。
|
||||
/// </summary>
|
||||
public static DebuggerComponent Debugger { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取下载组件。
|
||||
/// </summary>
|
||||
public static DownloadComponent Download { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取实体组件。
|
||||
/// </summary>
|
||||
public static EntityComponent Entity { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取事件组件。
|
||||
/// </summary>
|
||||
public static EventComponent Event { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取文件系统组件。
|
||||
/// </summary>
|
||||
public static FileSystemComponent FileSystem { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取有限状态机组件。
|
||||
/// </summary>
|
||||
public static FsmComponent Fsm { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取本地化组件。
|
||||
/// </summary>
|
||||
public static LocalizationComponent Localization { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取网络组件。
|
||||
/// </summary>
|
||||
public static NetworkComponent Network { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取对象池组件。
|
||||
/// </summary>
|
||||
public static ObjectPoolComponent ObjectPool { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取流程组件。
|
||||
/// </summary>
|
||||
public static ProcedureComponent Procedure { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取资源组件。
|
||||
/// </summary>
|
||||
public static ResourceComponent Resource { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取场景组件。
|
||||
/// </summary>
|
||||
public static SceneComponent Scene { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取配置组件。
|
||||
/// </summary>
|
||||
public static SettingComponent Setting { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取声音组件。
|
||||
/// </summary>
|
||||
public static SoundComponent Sound { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取界面组件。
|
||||
/// </summary>
|
||||
public static UIComponent UI { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获取网络组件。
|
||||
/// </summary>
|
||||
public static WebRequestComponent WebRequest { get; private set; }
|
||||
|
||||
private static void InitBuiltinComponents()
|
||||
{
|
||||
Base = UnityGameFramework.Runtime.GameEntry.GetComponent<BaseComponent>();
|
||||
Config = UnityGameFramework.Runtime.GameEntry.GetComponent<ConfigComponent>();
|
||||
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>();
|
||||
FileSystem = UnityGameFramework.Runtime.GameEntry.GetComponent<FileSystemComponent>();
|
||||
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>();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
using CustomComponent;
|
||||
using GeometryTD.CustomComponent;
|
||||
|
||||
/// <summary>
|
||||
/// 游戏入口。
|
||||
/// </summary>
|
||||
public partial class GameEntry
|
||||
{
|
||||
public static BuiltinDataComponent BuiltinData { get; private set; }
|
||||
|
||||
public static PlayerInventoryComponent PlayerInventory { get; private set; }
|
||||
|
||||
public static HPBarComponent HPBar { get; private set; }
|
||||
|
||||
public static UIRouterComponent UIRouter { get; private set; }
|
||||
|
||||
public static EventNodeComponent EventNode { get; private set; }
|
||||
|
||||
public static CombatNodeComponent CombatNode { get; private set; }
|
||||
|
||||
public static ShopNodeComponent ShopNode { get; private set; }
|
||||
|
||||
public static ResolutionAdapterComponent ResolutionAdapter { get; private set; }
|
||||
|
||||
public static SpriteCacheComponent SpriteCache { get; private set; }
|
||||
|
||||
public static InventoryGenerationComponent InventoryGeneration { get; private set; }
|
||||
|
||||
public static TagRegistryComponent TagRegistry { get; private set; }
|
||||
|
||||
private static void InitCustomComponents()
|
||||
{
|
||||
BuiltinData = UnityGameFramework.Runtime.GameEntry.GetComponent<BuiltinDataComponent>();
|
||||
PlayerInventory = UnityGameFramework.Runtime.GameEntry.GetComponent<PlayerInventoryComponent>();
|
||||
HPBar = UnityGameFramework.Runtime.GameEntry.GetComponent<HPBarComponent>();
|
||||
UIRouter = UnityGameFramework.Runtime.GameEntry.GetComponent<UIRouterComponent>();
|
||||
EventNode = UnityGameFramework.Runtime.GameEntry.GetComponent<EventNodeComponent>();
|
||||
CombatNode = UnityGameFramework.Runtime.GameEntry.GetComponent<CombatNodeComponent>();
|
||||
ShopNode = UnityGameFramework.Runtime.GameEntry.GetComponent<ShopNodeComponent>();
|
||||
ResolutionAdapter = UnityGameFramework.Runtime.GameEntry.GetComponent<ResolutionAdapterComponent>();
|
||||
SpriteCache = UnityGameFramework.Runtime.GameEntry.GetComponent<SpriteCacheComponent>();
|
||||
InventoryGeneration = UnityGameFramework.Runtime.GameEntry.GetComponent<InventoryGenerationComponent>();
|
||||
TagRegistry = UnityGameFramework.Runtime.GameEntry.GetComponent<TagRegistryComponent>();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
//------------------------------------------------------------
|
||||
// Game Framework
|
||||
// Copyright © 2013-2021 Jiang Yin. All rights reserved.
|
||||
// Homepage: https://gameframework.cn/
|
||||
// Feedback: mailto:ellan@gameframework.cn
|
||||
//------------------------------------------------------------
|
||||
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
/// 游戏入口。
|
||||
/// </summary>
|
||||
public partial class GameEntry : MonoBehaviour
|
||||
{
|
||||
private void Start()
|
||||
{
|
||||
InitBuiltinComponents();
|
||||
InitCustomComponents();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user