Newer
Older
DungeonShooting / DungeonShooting_Godot / src / framework / NodeComponent.cs
@小李xl 小李xl on 26 Aug 2022 295 bytes 架构调整
using Godot;

public abstract class NodeComponent<TG, TN> : Component<TG> where TN : Node where TG : KinematicBody2D
{
    public TN Node { get; }

    public NodeComponent(TN inst)
    {
        Node = inst;
    }

    public override void OnDestroy()
    {
        Node.QueueFree();
    }
}