コード例 #1
0
ファイル: NodePort.cs プロジェクト: zeronero13/u
 public static void SetWantsConnection(NodeBase node, NodePort port)
 {
     EncounterNodeGraph.wantsConnection    = true;
     EncounterNodeGraph.connectionNode     = node;
     EncounterNodeGraph.connectionNodePort = port;
 }
コード例 #2
0
ファイル: NodePort.cs プロジェクト: zeronero13/u
 public ConnectionMenuContextObject(NodePort port, string text)
 {
     this.port = port;
     this.text = text;
 }
コード例 #3
0
 public NodeBase getNextNodeBackward(NodePort port)
 {
     //VALUES
     return(port.parentNode.parentGraph.connections.getConnectionForPort(port).output.parentNode);
 }
コード例 #4
0
 public NodeBase getNextNodeForward(NodePort port)
 {
     //FLOW, IMPULSE
     return(port.parentNode.parentGraph.connections.getConnectionForPort(port).input.parentNode);
 }
コード例 #5
0
        public void AddConnection(NodePort output, NodePort input)
        {
            //obj == null akkor return;
            if (((object)output == null) || ((object)input == null))
            {
                return;
            }
            //same objects? by reference
            if (object.ReferenceEquals(output, input))
            {
                return;
            }
//			if (output.parentNode.parentGraph.wantsConnection != true) {
//				return;
//			}
            if (EncounterNodeGraph.wantsConnection != true)
            {
                return;
            }
            if (output.getPortType() != NodePortType.Out)
            {
                return;
            }
            if (input.getPortType() != NodePortType.In)
            {
                return;
            }

            if (isConnectionCanBeMade(output, input))
            {
                if (output.getConnectionType() == NodeConnectionType.FLOW)
                {
                    //Flow outputs only have 1 output line

                    //delete all connection (should be only 1) where this port exist
                    deleteAllConnectionRelatedOutput(output);

                    //add port
                    //connections.Add (new Connection (output, input));////

                    Connection newConn = new Connection(output, input);
                    connections.Add(newConn);

                    output.occupied = true;
                    input.occupied  = true;

                    return;
                }
                else if (output.getConnectionType() == NodeConnectionType.IMP)
                {
                    Connection newConn = new Connection(output, input);
                    connections.Add(newConn);

                    output.occupied = true;
                    input.occupied  = true;
                }
                else
                {
                    //BOOL, INT, NUM
                    deleteAllConnectionRelatedInput(input);

                    Connection newConn = new Connection(output, input);
                    connections.Add(newConn);

                    output.occupied = true;
                    input.occupied  = true;
                }
            }


            return;
        }
コード例 #6
0
 public Connection(NodePort output, NodePort input)
 {
     this.output = output;
     this.input  = input;
 }