public void ClearUndo(IUndoableObject obj) { ScriptableObject scriptableObject = this.CheckUndoObjectType(obj); if (scriptableObject != null) { Undo.ClearUndo(scriptableObject); } }
public void RegisterCompleteObjectUndo(IUndoableObject obj, string undoText) { ScriptableObject scriptableObject = this.CheckUndoObjectType(obj); if (scriptableObject != null) { Undo.RegisterCompleteObjectUndo(scriptableObject, undoText); } }
private ScriptableObject CheckUndoObjectType(IUndoableObject obj) { ScriptableObject scriptableObject = obj as ScriptableObject; if (scriptableObject == null) { Debug.LogError("Register Undo object is not a ScriptableObject"); } return(scriptableObject); }
internal static void ResetChildEditLevel(IUndoableObject child, int parentEditLevel, bool bindingEdit) { int targetLevel = parentEditLevel; if (bindingEdit && targetLevel > 0 && !(child is FieldManager.FieldDataManager)) { targetLevel--; } // if item's edit level is too high, // reduce it to match list while (child.EditLevel > targetLevel) { child.AcceptChanges(targetLevel, false); } // if item's edit level is too low, // increase it to match list while (child.EditLevel < targetLevel) { child.CopyState(targetLevel, false); } }
internal static void ResetChildEditLevel(IUndoableObject child, int parentEditLevel, bool bindingEdit) { int targetLevel = parentEditLevel; if (bindingEdit && targetLevel > 0 && !(child is FieldManager.FieldDataManager)) targetLevel--; // if item's edit level is too high, // reduce it to match list while (child.EditLevel > targetLevel) child.AcceptChanges(targetLevel, false); // if item's edit level is too low, // increase it to match list while (child.EditLevel < targetLevel) child.CopyState(targetLevel, false); }