Пример #1
0
        public DialogueGraph()
        {
            styleSheets.Add(Resources.Load <StyleSheet>("EditorStyle"));

            SetupZoom(ContentZoomer.DefaultMinScale, ContentZoomer.DefaultMaxScale);
            this.AddManipulator(new SelectionDragger());
            this.AddManipulator(new ContentDragger());
            this.AddManipulator(new RectangleSelector());
            var grid = new GridBackground();

            Insert(0, grid);
            AddElement(StartNode.Create());
            AddSearchWindow();
        }
Пример #2
0
        public static StartNode Create()
        {
            var node = new StartNode()
            {
                title        = "Entry Point",
                Guid         = System.Guid.NewGuid().ToString(),
                isEntryPoint = true,
                name         = "CustomNode"
            };
            var port = DialoguePort.Create(Direction.Output, Port.Capacity.Single);

            port.portName      = "Next";
            node.capabilities &= ~Capabilities.Movable;
            node.capabilities &= ~Capabilities.Deletable;

            node.outputContainer.Add(port);
            node.SetPosition(new Rect(100, 100, 0, 0));
            node.RefreshPorts();
            node.RefreshExpandedState();
            return(node);
        }