public static void LoadRaidMapScene(WorldMapHexagonTileData tileData, Ship ship) { SelectedTileData = tileData; SelectedShip = ship; Application.LoadLevel("RaidMap"); }
void GenerateDifficulty(WorldMapHexagonTileData tileData) { tileData.Difficulty = Vector2.Distance(tileData.TileCoordinate, Vector2.zero); }
//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; } } }
void OnSelectedTileChanged(WorldMapHexagonTileData selectedTileData) { StartRaidBtn.gameObject.SetActive(true); }
void Instance_OnRaidSuccessful(WorldMapHexagonTileData tileData) { tileData.Visited = true; }