예제 #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;
     }
     
 }
예제 #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();
 }
예제 #3
0
 // Use this for initialization
 void Start()
 {
     Debug.Log("Start Hex Map");
     baseTileObject = GameObject.FindObjectOfType<HexMapTile>();
 }
예제 #4
0
    public void ClearMapTiles()
    {
        mapSpawner.ClearMapRoot();
        selectedTile = null;
        hexMap = new HexMap();
        loadedMapFileIndex = -1;
        _hexTileLookup = new Dictionary<string, int>();

    }
예제 #5
0
 public void AddTile(HexMapTile tempTile)
 {
     hexMap.AddTile(tempTile);
     HexTileLookup.Add(tempTile.TileCoords.x + "," + tempTile.TileCoords.z, MapManager.Instance.hexMap.HexTiles.Count - 1);
 }
예제 #6
0
 public void SelectAll()
 {
     foreach (HexMapTile tile in MapManager.Instance.hexMap.HexTiles)
     {
         tile.SetSelected(true);
     }
     selectedTile = null;
 }
예제 #7
0
파일: HexMap.cs 프로젝트: sclarke27/HexGame
 public void AddTile(HexMapTile newTile)
 {
     _hexTiles.Add(newTile);
 }
예제 #8
0
    public HexMapSpawner() {
        Debug.Log("Hex Map Spawner: start");
        baseTileObject = GameObject.FindObjectOfType<HexMapTile>();
        baseTileObject.gameObject.SetActive(false);

    }