private void GenerateLog(int op, IntVector2 currentCoordinates) { BaseGridCell designatedCell = cells[currentCoordinates.x, currentCoordinates.z]; int heightBeforeOp = designatedCell.height; int[,] target = DrawingHandler.GetComponent <DrawingHandler>().height; int targetHeight = target[currentCoordinates.x, currentCoordinates.z]; if (op == 1) { if (heightBeforeOp < targetHeight) { BlockBuilderLog.Log(logPath, id, "Correct Addition"); } else { BlockBuilderLog.Log(logPath, id, "Incorrect Addition"); } } else { if (heightBeforeOp > targetHeight) { BlockBuilderLog.Log(logPath, id, "Correct Deletion"); } else { BlockBuilderLog.Log(logPath, id, "Incorrect Deletion"); } } }
private void DeleteCubeFromCoordinate(IntVector2 coordinates) { BaseGridCell designatedCell = cells[coordinates.x, coordinates.z]; designatedCell.DeleteCube(); DrawingHandler.GetComponent <DrawingHandler>().DrawMultiView(cells); }
private void CreateCell(IntVector2 coordinates) { BaseGridCell newCell = Instantiate(cellPrefab) as BaseGridCell; cells[coordinates.x, coordinates.z] = newCell; newCell.coordinates = coordinates; newCell.name = "Cell " + coordinates.x + ", " + coordinates.z; newCell.transform.parent = this.transform; newCell.transform.localPosition = new Vector3( coordinates.x - size.x * cellLength / 2 + cellLength / 2, -cellHeight / 2, coordinates.z - size.z * cellLength / 2 + cellLength / 2); }
private void AddCubeToCoordinate(IntVector2 coordinates) { BaseGridCell designatedCell = cells[coordinates.x, coordinates.z]; designatedCell.AddCube(); DrawingHandler.GetComponent <DrawingHandler>().DrawMultiView(cells); // //Should probably move this to some different script that handles the drawing //Convert it into a 3D boolean array /*Dictionary<Segment, LineType> topViewMap = ThreeView.GetTopView(cells); * GameObject currentTopViewPanel = GameObject.Find("Current Top View Panel"); * currentTopViewPanel.GetComponent<ViewPanel>().DrawView(topViewMap);*/ }
//Simply reverts the highlighted color of the cell private void UnhighlightCell(IntVector2 coordinates) { BaseGridCell designatedCell = cells[coordinates.x, coordinates.z]; designatedCell.Unhighlight(); }