public void OpenPortSearch(Type type, Vector2 screenMousePosition, UdonPort port, Direction direction)
 {
     // offset search window to appear next to mouse
     screenMousePosition.x         += 140;
     screenMousePosition.y         += 0;
     _portSearchWindow.typeToSearch = type;
     _portSearchWindow.startingPort = port;
     _portSearchWindow.direction    = direction;
     SearchWindow.Open(new SearchWindowContext(screenMousePosition, 360, 360), _portSearchWindow);
 }
Ejemplo n.º 2
0
        public static Port Create(string portName, Direction portDirection, IEdgeConnectorListener connectorListener, Type type, UdonNodeData data, int index, Orientation orientation = Orientation.Horizontal)
        {
            Capacity capacity = Capacity.Single;

            if (portDirection == Direction.Input && type == null || portDirection == Direction.Output && type != null)
            {
                capacity = Capacity.Multi;
            }
            var port = new UdonPort(orientation, portDirection, capacity, type)
            {
                m_EdgeConnector = new EdgeConnector <Edge>(connectorListener),
            };

            port.portName        = portName;
            port._udonNodeData   = data;
            port._nodeValueIndex = index;

            port.SetupPort();
            return(port);
        }