Exemplo n.º 1
0
 public void SetSelectedTile(HexMapTile tile)
 {
     selectedTile = tile;
     gameObject.SetActive(selectedTile != null);
     if (selectedTile != null)
     {
         xCoordLabel.text = selectedTile.TileCoords.x.ToString();
         yCoordLabel.text = selectedTile.TileCoords.z.ToString();
         typeDropdown.value = (int)selectedTile.HexTileData.TileType;
     } else
     {
         typeDropdown.value = 0;
     }
     
 }
Exemplo n.º 2
0
 public void SelectMapTile(HexMapTile newSelectedTile)
 {
     if (newSelectedTile == selectedTile)
     {
         selectedTile.SetSelected(false);
         selectedTile = null;
         UpdateSelectedTilePanel();
         return;
     }
     if(selectedTile != null)
     {
         selectedTile.SetSelected(false);
     }
     selectedTile = newSelectedTile;
     selectedTile.SetSelected(true);
     UpdateSelectedTilePanel();
 }
Exemplo n.º 3
0
 // Use this for initialization
 void Start()
 {
     Debug.Log("Start Hex Map");
     baseTileObject = GameObject.FindObjectOfType<HexMapTile>();
 }
Exemplo n.º 4
0
    public void ClearMapTiles()
    {
        mapSpawner.ClearMapRoot();
        selectedTile = null;
        hexMap = new HexMap();
        loadedMapFileIndex = -1;
        _hexTileLookup = new Dictionary<string, int>();

    }
Exemplo n.º 5
0
 public void AddTile(HexMapTile tempTile)
 {
     hexMap.AddTile(tempTile);
     HexTileLookup.Add(tempTile.TileCoords.x + "," + tempTile.TileCoords.z, MapManager.Instance.hexMap.HexTiles.Count - 1);
 }
Exemplo n.º 6
0
 public void SelectAll()
 {
     foreach (HexMapTile tile in MapManager.Instance.hexMap.HexTiles)
     {
         tile.SetSelected(true);
     }
     selectedTile = null;
 }
Exemplo n.º 7
0
 public void AddTile(HexMapTile newTile)
 {
     _hexTiles.Add(newTile);
 }
Exemplo n.º 8
0
    public HexMapSpawner() {
        Debug.Log("Hex Map Spawner: start");
        baseTileObject = GameObject.FindObjectOfType<HexMapTile>();
        baseTileObject.gameObject.SetActive(false);

    }