public void StartNewDrag() { selectedWall = WallUnderMouse(activatedCamera, wallsLayer); originWallPosition = selectedWall.getPosition(); originWallZRot = selectedWall.getZRotation(); isDragging = true; }
private void EndCurrentDrag() { if (!selectedWall.exists) { return; } Vector3 finalPos = selectedWall.wallGO.transform.position; Vector3 finalRot = selectedWall.wallGO.transform.GetChild(0).eulerAngles; selectedWall.setPositionRotation(new float[3] { finalPos.x, finalPos.y, finalPos.z }, finalRot.z); Track.FinalizeWallDrag(selectedWall.time, selectedWall.getType(), originWallPosition, selectedWall.getPosition(), originWallZRot, selectedWall.getZRotation()); Track.HistoryChangeDragWall(selectedWall.getType(), selectedWall.time, originWallPosition, selectedWall.getPosition()); selectedWall = new EditorWall(); originWallPosition = new float[] { 0, 0, 0 }; originWallZRot = 0f; mouseWallOffset = Vector3.zero; isDragging = false; }