Exemple #1
0
    private void ExpandOnNeighbours()
    {
        var neighbours = GetNeighbouringCities();

        var adjacentNeighbours = HexGridHelper.GetAdjacentSides(neighbours);

        foreach (var an in adjacentNeighbours)
        {
            Towers.GetComponent <VertexManager>().GetVertexFromTwoSides(an.Value1, an.Value2).SetActive(false);
        }

        foreach (var n in neighbours)
        {
            Walls.GetComponent <EdgeManager>().GetEdge(n).SetActive(false);
            Gates.GetComponent <EdgeManager>().GetEdge(n).SetActive(false);
            var towers = Towers.GetComponent <VertexManager>().GetVertexFromSide(n);
            towers[0].SetActive(false);
            towers[1].SetActive(false);

            BoardManager.FindTile(HexGridHelper.FindNeighbour(TileRef.Coord, n))
            .CityRef.GetComponent <CastleTileMasterBase>()
            .ReactToExpansion();
        }
    }