void Start() { // FIXME is new object the way to go?? Or scriptable object without new keyword?? Or static?? MazeFrameCreator mazeFrameCreator = new MazeFrameCreatorMeshIcosahedron(2, 4) { Scale = new Vector3(10, 10, 10), Jitter = 0f }; mazeFrame = mazeFrameCreator.GenerateEmptyMazeFrame(); for (int i = 0; i <= 3; i++) { mazeFrame.SetActiveQuadrant(i); mazeFrameCreator.GenerateMaze(ref mazeFrame); mazeFrame.SetOnShortestPath(mazeFrame.Quadrants[i], i); // HACKY } mazeFrame.ActivateAllNodes(); //mazeFrame.KeepOnlyShortestPathConnections(); mazeFrame.AddOffsetStartAndEndNodes(Vector3.Scale(Vector3.forward, mazeFrameCreator.Scale) * 3, true); mazeFrame.AddPathSegments(); //mazeFrameSplines = new MazeFrameSplines(mazeFrame); //GameObject mazeObjects = null; //MazePopulator.PopulateWithSplineFittedBars(mazeFrame, ref mazeFrameSplines, ref mazeObjects, new Vector3(2, .15f, 1)); //GameObject player = null; //GameObject cameraRig = null; //MazePopulator.PlacePlayerAndCamera(ref player, ref cameraRig, mazeFrame.StartNode.Position + (Vector3.Scale(Vector3.forward, mazeFrameCreator.Scale) * 1.5f)); }
/// <summary> /// Generate maze from maze frame, inside quadrant specified by <paramref name="quadrantInd"/>. /// </summary> /// <returns>A maze object containing the maze.</returns> /// <param name="mazeFrame">Maze frame.</param> /// <param name="quadrantInd">Index of quadrant in which to build maze.</param> public void GenerateMaze(ref MazeFrame mazeFrame, int quadrantInd) { // Active quadrant mazeFrame.SetActiveQuadrant(quadrantInd); // Build maze and label GenerateMaze(ref mazeFrame); // Reactivate all nodes mazeFrame.ActivateAllNodes(); }