using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEditor; namespace MoreMountains.Tools { /// /// Custom editor for the MMTransformRandomizer class /// [CustomEditor(typeof(MMTransformRandomizer), true)] [CanEditMultipleObjects] public class MMTransformRandomizerEditor : Editor { /// /// On inspector we handle undo and display a test button /// public override void OnInspectorGUI() { serializedObject.Update(); Undo.RecordObject(target, "Modified MMTransformRandomizer"); DrawDefaultInspector(); EditorGUILayout.Space(); EditorGUILayout.LabelField("Test", EditorStyles.boldLabel); if (GUILayout.Button("Randomize")) { foreach (MMTransformRandomizer randomizer in targets) { randomizer.Randomize(); } } } } }