public static Block CreateBlock(Flowchart flowchart, Vector2 position) { Block newBlock = flowchart.CreateBlock(position); Undo.RegisterCreatedObjectUndo(newBlock, "New Block"); ShowBlockInspector(flowchart); flowchart.selectedBlock = newBlock; flowchart.ClearSelectedCommands(); return newBlock; }
public static Block CreateBlock(Flowchart flowchart, Vector2 position) { Block newBlock = flowchart.CreateBlock(position); Undo.RegisterCreatedObjectUndo(newBlock, "New Block"); ShowBlockInspector(flowchart); flowchart.SelectedBlock = newBlock; flowchart.ClearSelectedCommands(); return(newBlock); }
public static Block CreateBlock(Flowchart flowchart, Vector2 position) { Block newBlock = flowchart.CreateBlock(position); Undo.RegisterCreatedObjectUndo(newBlock, "New Block"); // Use AddSelected instead of Select for when multiple blocks are duplicated flowchart.AddSelectedBlock(newBlock); SetBlockForInspector(flowchart, newBlock); return newBlock; }