private static void GenerateNegZMutation(BuildingLot _lot) { List <Panel> addedPanels = new List <Panel>(); // set new height, width and length // Calculate size of mutation int newHeight = (int)_lot.GetCurrentBuildingHeight() / 2; newHeight = (int)Random.Range(newHeight, _lot.GetCurrentBuildingHeight()); if (newHeight <= 1) { return; } _lot.SetCurrentBuildingHeight(newHeight); int newWidth = (int)Random.Range(1, (_lot.GetNegZWidth() + 1)); int newLength = (int)Random.Range(1, _lot.GetOffsetZ() + 1); if (newWidth == 1) { return; } // Generate panels! Vector3 pos = _lot.transform.position + new Vector3(_lot.GetOffsetX(), 0.0f, _lot.GetOffsetZ() + (float)panelSize / 2 - newLength); GenerateNegXPanels(_lot, newLength, pos, addedPanels); pos = _lot.transform.position + new Vector3(_lot.GetOffsetX() + newWidth, 0.0f, _lot.GetOffsetZ() + (float)panelSize / 2 - newLength); GeneratePosXPanels(_lot, newLength, pos, addedPanels); pos = _lot.transform.position + new Vector3(_lot.GetOffsetX() + (float)panelSize / 2, 0.0f, _lot.GetOffsetZ() - newLength); GenerateNegZPanels(_lot, newWidth, pos, addedPanels); pos = _lot.transform.position + new Vector3(_lot.GetOffsetX() + (float)panelSize / 2, 0.0f, _lot.GetOffsetZ()); GeneratePosZPanels(_lot, newWidth, pos, addedPanels); pos = _lot.transform.position + new Vector3(_lot.GetOffsetX() + (float)panelSize / 2, newHeight - (float)panelSize / 2, _lot.GetOffsetZ() - newLength + (float)panelSize / 2); GeneratePosYPanels(_lot, newWidth, newLength, pos, addedPanels); if (newWidth == _lot.GetNegZWidth()) { _lot.SetNegXWidth(_lot.GetNegXWidth() + newLength); _lot.SetPosXWidth(_lot.GetPosXWidth() + newLength); _lot.SetOffsetZ(_lot.GetOffsetZ() - newLength); } MergeList(_lot, addedPanels); }