コード例 #1
0
        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);
            }
        }
コード例 #2
0
ファイル: DialogNodeView.cs プロジェクト: annadeja/Inzynierka
    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();
    }
コード例 #3
0
        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); });
        }