Beispiel #1
0
        public LogicNode(Connection connection, LogicGraphView nodeParent)
        {
            hideLabelOfPropertyFieldSheet = Resources.Load <StyleSheet>("PropertyField2USS");

            GUID = Guid.NewGuid().ToString();

            this.connection = connection;
            this.nodeParent = nodeParent;
            title           = connection.Title + " - " + connection.gameObject.name;

            //capabilities &= ~Capabilities.Deletable;

            foreach (BasePort basePort in connection.BasePorts)
            {
                GeneratePort(basePort);
            }

            RefreshExpandedState();
            RefreshPorts();

            DrawNodeFields();
            CreateOriginLine();

            UpdatePosition();
        }
        internal void Init(LogicGraphView graphView, SceneView rootVE)
        {
            this.graphView = graphView;
            this.rootVE    = rootVE;

            indentationIcon = new Texture2D(1, 1);
            indentationIcon.SetPixel(0, 0, new Color(0, 0, 0, 0));
            indentationIcon.Apply();

            GetAllConnectionTypes();
        }
Beispiel #3
0
        private static void OnSceneGUI(SceneView sceneView)
        {
            if (Event.current.type == EventType.KeyDown && Event.current.keyCode == KeyCode.Space)
            {
                LogicGraphView graphView = graphViews.FirstOrDefault(g => g.SceneView == sceneView);
                if (graphView != null)
                {
                    graphView.RequestSearchWindow(GUIUtility.GUIToScreenPoint(Event.current.mousePosition));
                }
            }

            if (Event.current.type == EventType.Repaint)
            {
                LogicGraphView graphView = graphViews.FirstOrDefault(g => g.SceneView == sceneView);
                if (graphView != null)
                {
                    graphView.UpdateGraphView(connections.ToArray());
                }
            }
        }