示例#1
0
    public static void LoadRaidMapScene(WorldMapHexagonTileData tileData, Ship ship)
    {
        SelectedTileData = tileData;
        SelectedShip = ship;

        Application.LoadLevel("RaidMap");
    }
示例#2
0
 void GenerateDifficulty(WorldMapHexagonTileData tileData)
 {
     tileData.Difficulty = Vector2.Distance(tileData.TileCoordinate, Vector2.zero);
 }
示例#3
0
    //Todo: Refactor this approach
    void DiscoverNeighbourTiles(WorldMapHexagonTileData tileData)
    {
        for (int i = 0; i < tileData.Tile.Neighbours.Length; i++)
        {
            Vector2 neighbourCoord = new Vector2();
            if (tileData.TileCoordinate.y % 2 == 0)
            {
                switch (i)
                {
                    case 0:
                        neighbourCoord = new Vector2(tileData.TileCoordinate.x, tileData.TileCoordinate.y + 1);
                        break;
                    case 1:
                        neighbourCoord = new Vector2(tileData.TileCoordinate.x + 1, tileData.TileCoordinate.y);
                        break;
                    case 2:
                        neighbourCoord = new Vector2(tileData.TileCoordinate.x, tileData.TileCoordinate.y - 1);
                        break;
                    case 3:
                        neighbourCoord = new Vector2(tileData.TileCoordinate.x - 1, tileData.TileCoordinate.y - 1);
                        break;
                    case 4:
                        neighbourCoord = new Vector2(tileData.TileCoordinate.x - 1, tileData.TileCoordinate.y);
                        break;
                    case 5:
                        neighbourCoord = new Vector2(tileData.TileCoordinate.x - 1, tileData.TileCoordinate.y + 1);
                        break;
                }
            }
            else
            {
                switch (i)
                {
                    case 0:
                        neighbourCoord = new Vector2(tileData.TileCoordinate.x + 1, tileData.TileCoordinate.y + 1);
                        break;
                    case 1:
                        neighbourCoord = new Vector2(tileData.TileCoordinate.x + 1, tileData.TileCoordinate.y);
                        break;
                    case 2:
                        neighbourCoord = new Vector2(tileData.TileCoordinate.x + 1, tileData.TileCoordinate.y - 1);
                        break;
                    case 3:
                        neighbourCoord = new Vector2(tileData.TileCoordinate.x, tileData.TileCoordinate.y - 1);
                        break;
                    case 4:
                        neighbourCoord = new Vector2(tileData.TileCoordinate.x - 1, tileData.TileCoordinate.y);
                        break;
                    case 5:
                        neighbourCoord = new Vector2(tileData.TileCoordinate.x, tileData.TileCoordinate.y + 1);
                        break;
                }
            }

            if (DataCarrier.PersistentData.WorldRepresentation.ContainsKey(neighbourCoord))
            {
                tileData.Tile.Neighbours[i] = DataCarrier.PersistentData.WorldRepresentation[neighbourCoord].Tile;
            }
        }
    }
示例#4
0
 void OnSelectedTileChanged(WorldMapHexagonTileData selectedTileData)
 {
     StartRaidBtn.gameObject.SetActive(true);
 }
示例#5
0
 void Instance_OnRaidSuccessful(WorldMapHexagonTileData tileData)
 {
     tileData.Visited = true;
 }