public void AddMapSlot(string path) { GameObject mapSlotObj = Instantiate(mapSlotPrefab, mapSlotHolder.transform); MapSlot mapSlot = mapSlotObj.GetComponent <MapSlot>(); mapSlot.SetPath(path, true); }
public SeatMap(int cols, int rows) { NumCols = cols; NumRows = rows; Slots = new MapSlot[rows][]; for (var i = 0; i < rows; i++) { Slots[i] = new MapSlot[cols]; } }
public void CreatNewMap() { GameObject mapSlotObj = Instantiate(mapSlotPrefab, mapSlotHolder.transform); MapSlot mapSlot = mapSlotObj.GetComponent <MapSlot>(); creationMenu.gameObject.SetActive(true); creationMenu.StartCreation(mapSlot); gameObject.SetActive(false); }
public void StartCreation(MapSlot mapSlot) { myMapSlot = mapSlot; }
public MapSlot SetOccupied(bool newValue) { MapSlot slot = new MapSlot(slotIndex,slotCoords,newValue); return slot; }
public MapNode(MapSlot newSlot, MapRegion newRegion) { occupiedSlot = newSlot; region = newRegion; }
Dictionary<Vector2, MapSlot> GenerateMapSlots() { int horTownSlots = 3; int vertTownSlots = 3; townSlotSideSize=Screen.height/vertTownSlots; float borderOffset = 20f; townAreaSpriteSize = 75f; float gapBetweenTownSlots = 0f; Dictionary<Vector2, MapSlot> townSlotCenters = new Dictionary<Vector2, MapSlot>(); for (int i = 0; i < vertTownSlots; i++) { for (int j = 0; j < horTownSlots; j++) { //Y coord must be inverted because in UI elements higher Y goes up and lower Y goes down Vector2 newTownUpperleftPos = new Vector2(borderOffset + (townSlotSideSize + gapBetweenTownSlots) * j, -(borderOffset + (townSlotSideSize + gapBetweenTownSlots) * i)); MapSlot newSlot = new MapSlot(new Vector2(j, i), newTownUpperleftPos + new Vector2(townSlotSideSize * 0.5f, -townSlotSideSize * 0.5f)); townSlotCenters.Add(new Vector2(j, i), newSlot);//new Vector2(townSlotSideSize*j,townSlotSideSize*i)); //print ("Slot:"+j+"|"+i+":"+newTownUpperleftPos); } } return townSlotCenters; }