예제 #1
0
        /// <summary>
        /// Creates a new node and connects it to the loaded one.
        /// </summary>
        /// <param name="nodeType"></param>
        protected virtual void NewAutomaticNode(System.Type nodeType)
        {
            int nodeIndex = db.GetLoadedNodeKey(nodeType);

            Event currentEvent = Event.current;

            Vector2 mousePos = currentEvent.mousePosition;

            AbstractNode newNode = db.AddNode(nodeIndex, mousePos);

            ConnectNode(db.DragData.OriginNodeLinkID, newNode.UniqueID);
        }
예제 #2
0
        public virtual void Populate()
        {
            InitializeDB();

            EditorWindow.GetWindow <Dialog_Editor>().titleContent.text = editorTitle;

            // If there are no nodes, will add the property node
            if (!db.HasNodeType(typeof(PropertiesNode)))
            {
                db.AddNode(db.GetLoadedNodeKey(typeof(PropertiesNode)));
            }
        }