void AddPowerupToMapPiece(MapPieceData mapPieceData, GameObject mapPieceObject) { int whichPowerUp = PowerupPicker(); GameObject powerup = Instantiate(FindObjectOfType <PowerUp_Manager>().powerUps[whichPowerUp].powerUpObject, Vector3.zero, FindObjectOfType <PowerUp_Manager>().powerUps[whichPowerUp].powerUpObject.transform.rotation, mapPieceObject.transform) as GameObject; powerup.transform.localPosition = mapPieceData.powerUpPos; }
private List <MapModification> ModifyDefaultWeightsFromMapPieces(List <MapModification> io_weights, MapPieceData i_pieceData) { foreach (MapModification modifier in i_pieceData.Modifications) { if (modifier.Key == BackendConstants.COMBAT_MIN) { io_weights[(int)MapAreaTypes.Combat].Amount += (int)modifier.Amount; } else if (modifier.Key == BackendConstants.EXPLORE_MIN) { io_weights[(int)MapAreaTypes.Explore].Amount += (int)modifier.Amount; } else if (modifier.Key == BackendConstants.MISC_MIN) { io_weights[(int)MapAreaTypes.Misc].Amount += (int)modifier.Amount; } } return(io_weights); }