private void OnGUI() { GUILayout.Space(5); array = (ArrayUndo <T>)EditorGUILayout.ObjectField(array, typeof(ArrayUndo <T>), true); GUILayout.Label("Current value"); ShowValue(); ChangeValue(); if (GUILayout.Button("Apply", GUILayout.Height(20))) { if (array == null) { return; } Undo.RecordObject(array, "Modify Vertices"); ApplyVertexFactors(); } }
private void OnEnable() { Undo.undoRedoPerformed += this.UndoRedoCallback; array = GameObject.FindObjectOfType <ArrayUndo <T> >(); }