Newer
Older
DungeonShooting / DungeonShooting_Godot / src / framework / ui / grid / UiCell.cs
@小李xl 小李xl on 24 Jun 2023 594 bytes 将玩家血条改为单颗红心

using Godot;

public abstract class UiCell<TNodeType, TUiNodeType, T> : IDestroy where TNodeType : Node where TUiNodeType : IUiNode<TNodeType, TUiNodeType>
{
    public bool IsDestroyed { get; private set; }
    
    public UiGrid<TNodeType, TUiNodeType, T> Grid { get; set; }
    public TUiNodeType CellNode { get; set; }
    public T Data { get; set; }

    public virtual void OnInit()
    {
    }

    public virtual void OnSetData(T data)
    {
    }

    public void Destroy()
    {
        if (IsDestroyed)
        {
            return;
        }

        IsDestroyed = true;
    }
}