Newer
Older
DungeonShooting / DungeonShooting_Godot / src / framework / ui / grid / UiCell.cs
@小李xl 小李xl on 24 Jun 2023 594 bytes 将玩家血条改为单颗红心
  1.  
  2. using Godot;
  3.  
  4. public abstract class UiCell<TNodeType, TUiNodeType, T> : IDestroy where TNodeType : Node where TUiNodeType : IUiNode<TNodeType, TUiNodeType>
  5. {
  6. public bool IsDestroyed { get; private set; }
  7. public UiGrid<TNodeType, TUiNodeType, T> Grid { get; set; }
  8. public TUiNodeType CellNode { get; set; }
  9. public T Data { get; set; }
  10.  
  11. public virtual void OnInit()
  12. {
  13. }
  14.  
  15. public virtual void OnSetData(T data)
  16. {
  17. }
  18.  
  19. public void Destroy()
  20. {
  21. if (IsDestroyed)
  22. {
  23. return;
  24. }
  25.  
  26. IsDestroyed = true;
  27. }
  28. }