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