public FsmGraphView(FsmGraphObject fsmGraphObject) { VisualElementExtensions.AddManipulator(this, new ContentDragger()); VisualElementExtensions.AddManipulator(this, new SelectionDragger()); style.flexGrow = 1f; foreach (StateInstanceNode node in fsmGraphObject.GetNodes()) { StateInstanceNodeView nodeView = new StateInstanceNodeView(node); nodeView.SetPosition(FindPosition(nodeView)); nodeViews.Add(node.stateInstance.name, nodeView); AddElement(nodeView); } foreach (TransitionInstanceEdge transitionEdge in fsmGraphObject.edges) { TransitionEdgeView transitionView = new TransitionEdgeView(transitionEdge) { input = nodeViews[transitionEdge.transitionInstance.originState].inputPort, output = nodeViews[transitionEdge.transitionInstance.targetState].outputPort }; AddElement(transitionView); } }
public DialogNodeView() { VisualElementExtensions.AddManipulator(this, new ContentDragger()); VisualElementExtensions.AddManipulator(this, new ContentZoomer()); VisualElementExtensions.AddManipulator(this, new SelectionDragger()); VisualElementExtensions.AddManipulator(this, new RectangleSelector()); VisualElementExtensions.AddManipulator(this, new EdgeManipulator()); createRootNode(); }
public void SetupGUI() { VisualElement rootVisualContainer = new VisualElement(); this.m_ZoomManipulator = new ZoomManipulator(rootVisualContainer, this); VisualElementExtensions.AddManipulator(rootVisualContainer, m_ZoomManipulator); rootVisualContainer.RegisterCallback <WheelEvent>((x) => { Debug.Log(x); rootVisualContainer.HandleEvent(x); }); }