Newer
Older
DungeonShooting / DungeonShooting_Godot / src / game / ui / mapEditorMapTile / TerrainCell.cs
  1. namespace UI.MapEditorMapTile;
  2.  
  3. /// <summary>
  4. /// 地形选项, Data 为 TileSetTerrainInfo 的 index
  5. /// </summary>
  6. public class TerrainCell : UiCell<MapEditorMapTile.TerrainItem, int>
  7. {
  8. public TileSetTerrainInfo TileSetTerrainInfo;
  9. public override void OnInit()
  10. {
  11. CellNode.L_Select.Instance.Visible = false;
  12. }
  13.  
  14. public override void OnSetData(int data)
  15. {
  16. TileSetTerrainInfo = CellNode.UiPanel.TileSetSourceInfo.Terrain[data];
  17. CellNode.L_TerrainName.Instance.Text = TileSetTerrainInfo.Name;
  18. }
  19.  
  20. public override void OnSelect()
  21. {
  22. CellNode.L_Select.Instance.Visible = true;
  23. }
  24.  
  25. public override void OnUnSelect()
  26. {
  27. CellNode.L_Select.Instance.Visible = false;
  28. }
  29. }