Exemplo n.º 1
0
        void nodeDelete(List <NodeLayout> list)
        {
            foreach (var l in list)
            {
                foreach (var pin in l.Node.PinCollection.Get())
                {
                    WireController.Disconnect(pin);
                }

                _loadedGraph.ZoomOffset = _zoomArea.ZoomOffset;

                string path = AssetDatabase.GetAssetPath(l.Node.Root);
                _loadedGraph.Nodes.Remove(l.Node);
                AssetDatabase.ImportAsset(path);
                LoadGraph(_loadedGraph);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Bridge method to prevent initialization order issue.
        /// </summary>
        /// <param name="pin">Pin.</param>
        void onPinClicked(Pin pin)
        {
            Event e = Event.current;

            if (e.button == (int)MouseButton.Right)
            {
                WireController.Disconnect(pin);
            }
            else if (e.button == (int)MouseButton.Left)
            {
                if (_wireController.IsPinSelected)
                {
                    _wireController.Connect(pin);
                }
                else
                {
                    _wireController.Select(pin);
                }
            }
        }