private void CreateFollowMachine(Graph graph) { var bRect = _selectedNodes.BoundigRect(); _fmNode = (FollowMachineNode)graph.Editor().Repository.CreateNode( typeof(FollowMachineNode), bRect.center); if (_fmNode != null) { _fMachine = graph.Editor().Repository.CreateFollowMachine("Follow Machine"); _fmNode.FollowMachine = _fMachine; _inputNode = (InputNode)_fMachine.Editor().Repository.CreateNode(typeof(InputNode), bRect.center); _outputNode = (OutputNode)_fMachine.Editor().Repository.CreateNode(typeof(OutputNode), bRect.center); _inputNode.Editor().Move(Vector2.left * (bRect.width / 2 + 300)); _outputNode.Editor().Move(Vector2.right * (bRect.width / 2 + 200)); _fMachine.Position = graph.Position; _fMachine.Zoom = graph.Zoom; _fmNode.Editor().OnShow(); } }