static State SetNodeEnabledState(State previousState, SetNodeEnabledStateAction action) { Undo.RecordObjects(action.NodeToConvert.Select(n => n.NodeAssetReference).ToArray(), action.State == ModelState.Enabled ? "Enable Nodes" : "Disable Nodes"); foreach (NodeModel nodeModel in action.NodeToConvert) { nodeModel.State = action.State; } previousState.MarkForUpdate(UpdateFlags.GraphTopology); return(previousState); }
static State SetNodeEnabledState(State previousState, SetNodeEnabledStateAction action) { Undo.RegisterCompleteObjectUndo((Object)previousState.AssetModel, action.State == ModelState.Enabled ? "Enable Nodes" : "Disable Nodes"); EditorUtility.SetDirty((Object)previousState.AssetModel); foreach (NodeModel nodeModel in action.NodeToConvert) { nodeModel.State = action.State; } previousState.MarkForUpdate(UpdateFlags.GraphTopology); return(previousState); }