Newer
Older
DungeonShooting / DungeonShooting_Godot / src / game / ui / tileSetEditorCombination / right / TileCell.cs
@小李xl 小李xl on 19 Dec 2023 851 bytes 组合图块, 更新纹理, 开发中
  1. using Godot;
  2.  
  3. namespace UI.TileSetEditorCombination;
  4.  
  5. public class TileCell : UiCell<TileSetEditorCombination.CellButton, ImportCombinationData>
  6. {
  7. public override void OnInit()
  8. {
  9. CellNode.L_SelectTexture.Instance.Visible = false;
  10. }
  11. public override void OnSetData(ImportCombinationData data)
  12. {
  13. CellNode.L_CellName.Instance.Text = data.CombinationInfo.Name;
  14. CellNode.L_PreviewImage.Instance.Texture = data.PreviewTexture;
  15. }
  16.  
  17. public override void OnDoubleClick()
  18. {
  19. //双击移除Cell数据
  20. //EventManager.EmitEvent(EventEnum.OnRemoveTileCell, Data);
  21. }
  22.  
  23. public override void OnSelect()
  24. {
  25. CellNode.L_SelectTexture.Instance.Visible = true;
  26. }
  27.  
  28. public override void OnUnSelect()
  29. {
  30. CellNode.L_SelectTexture.Instance.Visible = false;
  31. }
  32. }