static State DuplicateFunctionVariableDeclarations(State previousState, DuplicateFunctionVariableDeclarationsAction action) { List <VariableDeclarationModel> duplicatedModels = ((FunctionModel)action.FunctionModel).DuplicateFunctionVariableDeclarations(action.VariableDeclarationModels); previousState.EditorDataModel?.SelectElementsUponCreation(duplicatedModels, true); previousState.MarkForUpdate(UpdateFlags.GraphTopology); return(previousState); }
static State DuplicateFunctionVariableDeclarations(State previousState, DuplicateFunctionVariableDeclarationsAction action) { var functionModel = ((FunctionModel)action.FunctionModel); Undo.RegisterCompleteObjectUndo(functionModel.SerializableAsset, "Create Function Declarations"); List <VariableDeclarationModel> duplicatedModels = functionModel.DuplicateFunctionVariableDeclarations(action.VariableDeclarationModels); previousState.EditorDataModel?.SelectElementsUponCreation(duplicatedModels, true); previousState.MarkForUpdate(UpdateFlags.GraphTopology); return(previousState); }