コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }