123456789101112131415161718192021222324252627282930313233343536373839404142 |
- using System.Collections.Generic;
- using Godot;
- namespace TBL.GodotSharp.Content;
- /// <summary>
- /// 资源包节点
- /// </summary>
- public abstract partial class PackageNode : Node
- {
- /// <summary>
- /// 自身信息
- /// </summary>
- public abstract Info SelfInfo { get; }
- /// <summary>
- /// 依赖项信息集
- /// </summary>
- public abstract ICollection<DependencyInfo> Dependencies { get; }
- public override void _Ready()
- {
- Name = SelfInfo.ToString();
- }
- public override void _EnterTree()
- {
- if (SelfFileSystem != null)
- {
- Content.FileSystem.AddFileSystem(SelfFileSystem);
- }
- }
- public override void _ExitTree()
- {
- if (SelfFileSystem != null)
- {
- Content.FileSystem.RemoveFileSystem(SelfFileSystem);
- SelfFileSystem.Dispose();
- }
- }
- }
|