예제 #1
0
        public void OnEnable()
        {
            var root = this.GetRootVisualContainer();

            m_Graph = new StoryGraphView(this);
            m_Graph.RegisterCallback <KeyDownEvent>(OnSpaceDown);
            root.Add(m_Graph);
        }
예제 #2
0
        public StoryNode(StoryGraphView graph, Vector2 pos, string title, string text) : base()
        {
            this.title  = title;
            this.m_Text = text;
            m_Graph     = graph;
            SetPosition(new Rect(pos, GetPosition().size));
            //layout = new Rect(pos, size);

//            AddPort(Orientation.Horizontal, Direction.Input, "");
//            AddPort(Orientation.Horizontal, Direction.Input, "");
//            AddPort(Orientation.Horizontal, Direction.Output, "");


            var textBox = new TextField()
            {
                name           = "textBox",
                persistenceKey = "input",
                multiline      = true,
            };

            textBox.style.backgroundColor            = extensionContainer.style.backgroundColor;
            extensionContainer.style.backgroundColor = new Color(.2f, .2f, .2f);
//            var ext = new ScrollView();
//            ext.showHorizontal = false;
//            ext.showVertical = true;

//            ext.Add(textBox);
            extensionContainer.Add(textBox);
            textBox.SetValueAndNotify(m_Text);
            RefreshExpandedState();
            //capabilities |= Capabilities.Resizable;
            //style.positionType = PositionType.Manual;
            //Add(new StoryNodeResizer());

            AddMyPorts();
            contentContainer.AddStyleSheetPath("nodeStyles");
            //contentContainer.Add();
        }
예제 #3
0
 public MyEdgeConnectorListener(StoryGraphView graph)
 {
     m_Graph = graph;
 }