public void MirrorWallNE() { var container = BeatmapObjectContainerCollection.GetCollectionForType(BeatmapObject.Type.OBSTACLE); if (container is ObstaclesContainer wallsContainer) { var root = wallsContainer.transform.root; var wallPlacement = root.GetComponentInChildren <ObstaclePlacement>(); wallPlacement.RefreshVisuals(); var wallA = new BeatmapObstacle(2, BeatmapNote.LINE_INDEX_FAR_LEFT, BeatmapObstacle.VALUE_FULL_BARRIER, 1, 2, JSON.Parse("{\"_position\": [-1.5, 0]}")); wallPlacement.queuedData = wallA; wallPlacement.RoundedTime = wallPlacement.queuedData._time; wallPlacement.instantiatedContainer.transform.localScale = new Vector3(0, 0, wallPlacement.queuedData._duration * EditorScaleController.EditorScale); wallPlacement.ApplyToMap(); // Starts placement wallPlacement.ApplyToMap(); // Completes placement SelectionController.Select(wallA); _mirror.Mirror(); WallTest.CheckWall(wallsContainer, 0, 2, BeatmapNote.LINE_INDEX_MID_RIGHT, BeatmapObstacle.VALUE_FULL_BARRIER, 1, 2, JSON.Parse("{\"_position\": [-0.5, 0]}")); // Undo mirror _actionContainer.Undo(); WallTest.CheckWall(wallsContainer, 0, 2, BeatmapNote.LINE_INDEX_FAR_LEFT, BeatmapObstacle.VALUE_FULL_BARRIER, 1, 2, JSON.Parse("{\"_position\": [-1.5, 0]}")); } }
public void MirrorWallME() { var container = BeatmapObjectContainerCollection.GetCollectionForType(BeatmapObject.Type.OBSTACLE); if (container is ObstaclesContainer wallsContainer) { var root = wallsContainer.transform.root; var wallPlacement = root.GetComponentInChildren <ObstaclePlacement>(); wallPlacement.RefreshVisuals(); // What the actual f**k - example from mirroring in MMA2 //{"_time":1.5,"_lineIndex":1446,"_type":595141,"_duration":0.051851850003004074,"_width":2596} //{"_time":1.5,"_lineIndex":2958,"_type":595141,"_duration":0.051851850003004074,"_width":2596} var wallA = new BeatmapObstacle(2, 1446, 595141, 1, 2596); wallPlacement.queuedData = wallA; wallPlacement.RoundedTime = wallPlacement.queuedData._time; wallPlacement.instantiatedContainer.transform.localScale = new Vector3(0, 0, wallPlacement.queuedData._duration * EditorScaleController.EditorScale); wallPlacement.ApplyToMap(); // Starts placement wallPlacement.ApplyToMap(); // Completes placement SelectionController.Select(wallA); _mirror.Mirror(); WallTest.CheckWall(wallsContainer, 0, 2, 2958, 595141, 1, 2596); // Undo mirror _actionContainer.Undo(); WallTest.CheckWall(wallsContainer, 0, 2, 1446, 595141, 1, 2596); } }