1234567891011121314151617181920212223242526 |
- using Godot;
- namespace TBL.GodotSharp
- {
- /// <summary>
- /// 游戏核心主节点
- /// <para>作为游戏根节点及各个控制对象的持有者</para>
- /// </summary>
- public abstract partial class Game : Control
- {
- /// <summary>
- /// 全局单例
- /// </summary>
- public static Game Instance { get; private set; }
- public override void _EnterTree()
- {
- Instance = this;
- }
- public override void _ExitTree()
- {
- Instance = null;
- }
- }
- }
|