diff --git a/Assets/Scripts/MeshGenerator/ShapeGenerator.cs b/Assets/Scripts/MeshGenerator/ShapeGenerator.cs
index 660b075b3cfe7b908b8c33d60ef60badf5dd99bc..1753f61f28f7cb6ea482b244b4a6d2f72894e0eb 100644
--- a/Assets/Scripts/MeshGenerator/ShapeGenerator.cs
+++ b/Assets/Scripts/MeshGenerator/ShapeGenerator.cs
@@ -6,11 +6,13 @@ public abstract class ShapeGenerator : MonoBehaviour
     #region UnityMethods
     void Start() => GenerateShape();
 
+    #if UNITY_EDITOR
     void OnValidate()
     {
         // prevent 'SendMessage cannot be called during Awake, CheckConsistency, or OnValidate' warning
         UnityEditor.EditorApplication.delayCall += GenerateShape;
     }
+    #endif
     #endregion UnityMethods
 
     protected abstract void GenerateShape();