public void BuildButtonPress() { if (!buttonDepartures.isEnabled) { area_building_factory.CreateAreaBuilding(minGridCell, maxGridCell, size, AreaBuilding.TYPE_DEPARTURES); } else if (!buttonArrivals.isEnabled) { area_building_factory.CreateAreaBuilding(minGridCell, maxGridCell, size, AreaBuilding.TYPE_ARRIVALS); } else if (!buttonTerminal.isEnabled) { area_building_factory.CreateAreaBuilding(minGridCell, maxGridCell, size, AreaBuilding.TYPE_TERMINAL); } else if (!buttonSecurity.isEnabled) { area_building_factory.CreateAreaBuilding(minGridCell, maxGridCell, size, AreaBuilding.TYPE_SECURITY); } else { return; } buildingSmoke.StartSmoke(size); place_area_building.Complete(); }
public void Load(string filename) { airportName = ES2.Load <string>(filename + "?tag=airportName"); int areaBuildingListSize = ES2.Load <int>(filename + "?tag=areaBuildingListSize"); string area_building_tag = filename + "?tag=areaBuilding"; for (int i = 0; i < areaBuildingListSize; i++) { Vector2 minGridPos = ES2.Load <Vector2>(area_building_tag + i + "grid_position_min"); Vector2 maxGridPos = ES2.Load <Vector2>(area_building_tag + i + "grid_position_max"); Vector2 size = ES2.Load <Vector2>(area_building_tag + i + "grid_size"); AreaBuilding new_area_building = areaBuildingFactory.CreateAreaBuilding(GridHelper.GetGridCell(minGridPos), GridHelper.GetGridCell(minGridPos), size, 0); new_area_building.Load(filename, "?tag=areaBuilding" + i); } }