/// <summary> /// Notifies the system to start recording a new undo command. Any changes to the field after this is called /// will be recorded in the command. User must call <see cref="EndUndo"/> after field is done being changed. /// </summary> protected void StartUndo() { if (context.Component != null) { GameObjectUndo.RecordComponent(context.Component, path); } }
/// <summary> /// Notifies the system to start recording a new undo command. Any changes to the field after this is called /// will be recorded in the command. User must call <see cref="EndUndo"/> after field is done being changed. /// </summary> /// <param name="field">Name of the field being modified.</param> protected void StartUndo(string field) { if (inspectedObject is Component component) { GameObjectUndo.RecordComponent(component, field); } }