Newer
Older
DungeonShooting / DungeonShooting_Godot / src / game / ui / tileSetEditorProject / TileSetEditorProjectPanel.cs
  1. using Godot;
  2.  
  3. namespace UI.TileSetEditorProject;
  4.  
  5. public partial class TileSetEditorProjectPanel : TileSetEditorProject
  6. {
  7.  
  8. private UiGrid<TileButton, TileSetInfo> _grid;
  9. public override void OnCreateUi()
  10. {
  11. S_Back.Instance.Visible = PrevUi != null;
  12. S_Back.Instance.Pressed += () =>
  13. {
  14. OpenPrevUi();
  15. };
  16.  
  17. _grid = new UiGrid<TileButton, TileSetInfo>(S_TileButton, typeof(TileButtonCell));
  18. _grid.SetAutoColumns(true);
  19. _grid.SetCellOffset(new Vector2I(10, 10));
  20. _grid.SetHorizontalExpand(true);
  21. _grid.Add(new TileSetInfo()
  22. {
  23. Name = "测试数据"
  24. });
  25. }
  26.  
  27. public override void OnDestroyUi()
  28. {
  29. _grid.Destroy();
  30. }
  31.  
  32. }