void InstantiateCellDisplay(BrickArrangement inputBrickArrangement) { foreach (Cell cell in brickArrangement.arrangementGraph.availableCells) { availableCellsInScene.Add(Instantiate(brickCellMesh, inputBrickArrangement.GetRealCellPosition(cell) + inputBrickArrangement.displayCellOffset, Quaternion.identity, brickCellMesh.transform.parent)); } }
void UpdateLineDisplay(BrickArrangement inputBrickArrangement) { for (int i = 0; i < graphLines.Count; i++) { Vector3 lineDisplaySeparatorFactor = new Vector3(0, 0, 0); if (inputBrickArrangement.arrangementGraph.graphBranches[i].type >= 2 && inputBrickArrangement.arrangementGraph.graphBranches[i].type <= 5) { lineDisplaySeparatorFactor = lineDisplaySeparator * 1; } if (inputBrickArrangement.arrangementGraph.graphBranches[i].type >= 12 && inputBrickArrangement.arrangementGraph.graphBranches[i].type <= 15) { lineDisplaySeparatorFactor = lineDisplaySeparator * 2; } if (inputBrickArrangement.arrangementGraph.graphBranches[i].type >= -5 && inputBrickArrangement.arrangementGraph.graphBranches[i].type <= -2) { lineDisplaySeparatorFactor = lineDisplaySeparator * 0; } // horizontalSteps if (inputBrickArrangement.arrangementGraph.graphBranches[i].type == 2) { graphLines[i].material.color = gradientColours[4]; } if (inputBrickArrangement.arrangementGraph.graphBranches[i].type == 3) { graphLines[i].material.color = gradientColours[5]; } if (inputBrickArrangement.arrangementGraph.graphBranches[i].type == 4) { graphLines[i].material.color = gradientColours[6]; } if (inputBrickArrangement.arrangementGraph.graphBranches[i].type == 5) { graphLines[i].material.color = gradientColours[7]; } // upSteps if (inputBrickArrangement.arrangementGraph.graphBranches[i].type == 12) { graphLines[i].material.color = gradientColours[8]; } if (inputBrickArrangement.arrangementGraph.graphBranches[i].type == 13) { graphLines[i].material.color = gradientColours[9]; } if (inputBrickArrangement.arrangementGraph.graphBranches[i].type == 14) { graphLines[i].material.color = gradientColours[10]; } if (inputBrickArrangement.arrangementGraph.graphBranches[i].type == 15) { graphLines[i].material.color = gradientColours[11]; } // downSteps if (inputBrickArrangement.arrangementGraph.graphBranches[i].type == -2) { graphLines[i].material.color = gradientColours[0]; } if (inputBrickArrangement.arrangementGraph.graphBranches[i].type == -3) { graphLines[i].material.color = gradientColours[1]; } if (inputBrickArrangement.arrangementGraph.graphBranches[i].type == -4) { graphLines[i].material.color = gradientColours[2]; } if (inputBrickArrangement.arrangementGraph.graphBranches[i].type == -5) { graphLines[i].material.color = gradientColours[3]; } graphLines[i].SetPosition(0, inputBrickArrangement.GetRealCellPosition(brickArrangement.arrangementGraph.graphBranches[i].start) + inputBrickArrangement.displayCellOffset + lineDisplaySeparatorFactor + new Vector3(0, 0.6f, 0)); graphLines[i].SetPosition(1, inputBrickArrangement.GetRealCellPosition(brickArrangement.arrangementGraph.graphBranches[i].end) + inputBrickArrangement.displayCellOffset + lineDisplaySeparatorFactor + new Vector3(0, 0.6f, 0)); } }
void InstantiateRobot() { robotObject = Instantiate(robotGameObject, brickArrangement.GetRealCellPosition(robotInScene.position), robotInScene.rotation); robotIsCreated = true; }