diff --git a/AVVR/Assets/_Scripts/MeshDimension/MeshDimensionCalculator.cs b/AVVR/Assets/_Scripts/MeshDimension/MeshDimensionCalculator.cs index fc722efc7b0ee419b1048a370a69ac20306490de..709a35c53fd427823e86f37945c666cb363fbc2c 100644 --- a/AVVR/Assets/_Scripts/MeshDimension/MeshDimensionCalculator.cs +++ b/AVVR/Assets/_Scripts/MeshDimension/MeshDimensionCalculator.cs @@ -1,4 +1,3 @@ -#if UNITY_EDITOR using UnityEngine; using UnityEditor; using System.Collections.Generic; @@ -80,7 +79,6 @@ public static class MeshDimensionCalculatorLogic return; } - Undo.RecordObject(targetObject.transform, "Reset To Origin"); targetObject.transform.position = Vector3.zero; Debug.Log("Target object has been reset to (0,0,0)."); } @@ -93,7 +91,6 @@ public static class MeshDimensionCalculatorLogic return; } - Undo.RecordObject(targetObject.transform, "Reset Floor To Zero"); Vector3 currentPosition = targetObject.transform.position; Vector3 newPosition = new Vector3(currentPosition.x, -floorY, currentPosition.z); targetObject.transform.position = newPosition; @@ -108,7 +105,6 @@ public static class MeshDimensionCalculatorLogic return; } - Undo.RecordObject(targetObject.transform, "Scale Object"); Vector3 currentScale = targetObject.transform.localScale; Vector3 newScale = Vector3.Scale(currentScale, scaleFactors); targetObject.transform.localScale = newScale; @@ -123,7 +119,6 @@ public static class MeshDimensionCalculatorLogic return; } - Undo.RecordObject(targetObject.transform, "Scale Object Uniform"); Vector3 currentScale = targetObject.transform.localScale; Vector3 newScale = currentScale * uniformScaleFactor; targetObject.transform.localScale = newScale; @@ -138,7 +133,6 @@ public static class MeshDimensionCalculatorLogic return; } - Undo.RecordObject(targetObject.transform, "Reset Scale"); targetObject.transform.localScale = Vector3.one; Debug.Log("Target object scale has been reset to (1, 1, 1)."); } @@ -167,7 +161,6 @@ public static class MeshDimensionCalculatorLogic } Vector3 scaleFactors = CalculateScaleFactorsForTargetDimensions(currentDimensions, targetDimensions); - Undo.RecordObject(targetObject.transform, "Scale To Target Dimensions"); Vector3 currentScale = targetObject.transform.localScale; Vector3 newScale = Vector3.Scale(currentScale, scaleFactors); targetObject.transform.localScale = newScale; @@ -175,6 +168,7 @@ public static class MeshDimensionCalculatorLogic } } +#if UNITY_EDITOR // MonoBehaviour Component public class MeshDimensionCalculator : MonoBehaviour {