Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

GraphView NodePort cant connect (SOLVED)

Discussion in 'UI Toolkit' started by neoneper, Sep 15, 2020.

  1. neoneper

    neoneper

    Joined:
    Nov 14, 2013
    Posts:
    48
    Hello guys. Im trying connect 2 nodes at graphView, but my nodes cnt connect. IDK.
    Both are of the float type and are of the same class. So I don't understand what I'm doing wrong

    Code (CSharp):
    1.             StateNode state = new StateNode();
    2.             Port inputport = state.InstantiatePort(Orientation.Horizontal, Direction.Input, Port.Capacity.Single, typeof(float));
    3.             Port outputport = state.InstantiatePort(Orientation.Horizontal, Direction.Output, Port.Capacity.Single, typeof(float));
    4.  
    5.             state.outputContainer.Add(outputport);
    6.             state.inputContainer.Add(inputport);
    7.        
    8.             state.RefreshExpandedState();
    9.             state.RefreshPorts();
    10.  
    11.             AddElement(state);

     
  2. neoneper

    neoneper

    Joined:
    Nov 14, 2013
    Posts:
    48
    OK. Solution:
    At GraphView:
    Code (CSharp):
    1.  public override List<Port> GetCompatiblePorts(Port startPort, NodeAdapter nodeAdapter)