//On building swap needs to check for a lot of scenarios. later, either just put these check in manager, and let spawner script just spawn. Or let the individual buildings // that affect vehicles do a call here on "drop"/Start() when instantiated in world. private void OnBuildingSwap(BuildingSwapEvent eve) { string inBuilding = eve.newBuilding.GetComponent <Building>().TypeOfBuilding; switch (inBuilding) { case "BicycleStand": //increase scooters/bikes int change = bikeMax / 2; bikeMax += change; //increase by 50%; //carMax -= change; // decrease by same amount Debug.Log("New bike max count: " + bikeMax + " car max count: " + carMax); break; case "GasStation": //increase "regular" cars carMax += maxVehicleCount / 4; // each extra gas station increaases the car count by a fourth of the maximum vehicles break; case "ElectricalStation": //increase just AI/electrical cars ratio break; case "ParkingLot": //increase max of vehicles break; case "SmartPark": //increase vehicle max a load break; } //also check what building was swapped out, this will affect values similarly but like, inverted. string outBuilding = eve.newBuilding.GetComponent <Building>().TypeOfBuilding; switch (outBuilding) { case "BicycleStand": Debug.Log("wowo"); break; case "GasStation": break; //increase just AI/electrical cars ratio case "ElectricalStation": break; //increase max of vehicles case "ParkingLot": break; //increase vehicle max a load case "SmartPark": break; } }
private void OnBuildingSwap(BuildingSwapEvent eve) { //add ref to audioSources of new added building on map to list here so they may be controlled from manager. AudioSource sound; if (eve.newBuilding.TryGetComponent <AudioSource>(out sound)) { audioObjects.Add(sound); } }
private void OnBuildingSwap(BuildingSwapEvent eve) { //get wanted building string wantedBuilding = currentObjective.GetComponent <Objective>().typeToBuild; //do the current objective checks: if (eve.newBuilding.GetComponent <Building>().TypeOfBuilding.Equals(wantedBuilding)) // find way to compare prefab types { Debug.Log("Placed building matches current objective target"); progressCount++; PrintObjective(); // update quest text for player if (progressCount == currentObjective.count) { ObjectiveSuccess(); } } }
private void OnBuildingSwap(BuildingSwapEvent eve) { }