public void PrintBoard() { tiledisplay = new WorldMapTileGameObject[currWorldMap.sizeX, currWorldMap.sizeY]; locationDisplay = new WorldMapLocationGameObject[currWorldMap.sizeX, currWorldMap.sizeY]; locationDictionary = new Dictionary <string, WorldMapLocationGameObject>(); locationNameDict = new Dictionary <string, WorldMapLocationGameObject>(); for (int x = 0; x < currWorldMap.sizeX; x++) { for (int y = 0; y < currWorldMap.sizeY; y++) { if (currWorldMap.worldMapDisplayData[x, y] != null) { WorldMapTileGameObject tilego = Instantiate <WorldMapTileGameObject>(tileGOPrefab, tileContainer); tilego.InitWorldMapObject(currWorldMap.worldMapDisplayData[x, y]); tiledisplay[x, y] = tilego; tilego.name = x + " " + y; if (currWorldMap.locations[x, y] != null) { //spawn the location LocationNode currNode = currWorldMap.locations[x, y]; WorldMapLocationGameObject go = Instantiate <WorldMapLocationGameObject>(locationPrefab, tileContainer); go.InitGameObject(currNode); locationDisplay[x, y] = go; go.name = x + " " + y; locationDictionary.Add(currNode.MapKey, go); locationNameDict.Add(currNode.AreaName, go); DrawNeighbors(currNode); } } } } }
public void InitLocationMenu(WorldMapLocationGameObject location, WorldMapManager wmm) { if (location == null) { // ToggleOff(); return; } missionInfoPanel.ToggleOff(); barPanel.ToggleOff(); ClearButtons(); pos = location.location.coords; this.wmm = wmm; missionButtons = new List <TextButton>(); text.text = location.location.AreaName; foreach (Mission mission in location.missions) { InstantiateMissionButton(mission); } foreach (LocationComponent loc in location.location.locationcomponents) { TextButton temp = Instantiate(MissionButtonPrefab, buttonContainer); missionButtons.Add(loc.GenerateButtion(temp, this)); } this.gameObject.SetActive(true); }
private void MissionLabelClicked(Mission m) { WorldMapSelector s = manager.worldMapelectorInstance; WorldMapLocationGameObject n = manager.locationDictionary[m.mapName]; s.MoveSelectorTo(n.location.coords.X, n.location.coords.Y); }
public void UpdateLocationNode() { if (currentMap.locations[mapPosX, mapPosY] != null) { CurrentLocationNode = worldMapManager.locationDisplay[mapPosX, mapPosY]; UpdateDisplay(); } else { CurrentLocationNode = null; UpdateDisplay(); } }
public void UpdataLocationNodeInfo(WorldMapLocationGameObject node) { if (node == null) { gameObject.SetActive(false); return; } gameObject.SetActive(true); currentNodeGO = node; currentNode = node.location; PrintInfo(); }
public void ToggleOnWorldMapLocationMenu(WorldMapLocationGameObject node) { worldMapLocationMenu.InitLocationMenu(node, worldMapManager); }