public override void OnInspectorGUI() { _serializedObject.Update(); GUILayout.Space(10); EditorGUILayout.PropertyField(_pointRadius); GUILayout.Space(10); EditorGUILayout.PropertyField(_color); GUILayout.Space(20); if (GUILayout.Button("Add Collision Point")) { Undo.RegisterCompleteObjectUndo(_customCollider, "add point"); _customCollider.AddCollisionPoint(); } GUILayout.Space(10); if (_collisionPoints.arraySize > 0 && _checkBoxes.arraySize > 0) { using (new GUILayout.VerticalScope(EditorStyles.helpBox)) { EditorGUILayout.LabelField("CollisionType - CollisionXZ is checking if the given point is inside all of CollisionPoints' X and Z Axis. CollisionXY is checking X and Y Axis.", EditorStyles.wordWrappedMiniLabel); using (new GUILayout.HorizontalScope(EditorStyles.helpBox)) { ShowCollisionType(); } GUILayout.Space(10); ReadCollisionPoints(); } } GUILayout.Space(10); if (GUILayout.Button("Remove Selected Point")) { _showMessage = false; if (_checkBoxes.arraySize > 0) { if (_customCollider.IsAnySelected()) { Undo.RegisterCompleteObjectUndo(_customCollider, "selected point"); _customCollider.RemoveCollisionPoint(); } else { _showMessage = true; } } } GUILayout.Space(10); if (GUILayout.Button("Remove All")) { Undo.RegisterCompleteObjectUndo(_customCollider, "all the points"); _customCollider.RemoveAll(); _showMessage = false; } if (_showMessage) { GUILayout.Space(10); EditorGUILayout.HelpBox("Select at least one point to remove", MessageType.Warning); } if (_serializedObject.ApplyModifiedProperties()) { SceneView.RepaintAll(); } }