Ejemplo n.º 1
0
	public void NewConnection(NodeConnectionArgs args) {
		if(CompatibleNodes(args.StartNode,args.EndNode)) {
			RegisterConnection(new NodeConnection(args.StartNode,args.EndNode));
			if(args.StartNode.IsInput == false) {
				args.EndNode.ParentNode.AddInputNode(args.StartNode.ParentNode);
			} else {
				args.StartNode.ParentNode.AddInputNode(args.EndNode.ParentNode);
			}
			args.StartNode.IsInConnection = true;
			args.EndNode.IsInConnection = true;
		} else {
			print ("Not connectible, input -> output and output -> input only between two unique nodes.");
		}
	}
Ejemplo n.º 2
0
	void StartConnection(NodeConnectionArgs args) {
		List<NodeConnection> toUnregsiter = new List<NodeConnection>();
		foreach(NodeConnection nc in connections.Keys) {
			if(nc.NodeInConnection(args.StartNode)) {
				toUnregsiter.Add(nc);
			}
		}
		foreach(NodeConnection nc in toUnregsiter) {
			UnregsiterConnection(nc);
		}
		if(activeLine != null) {
			Destroy (activeLine.gameObject);
		}
		activeLine = NodeLine.CreateNewLine(args.StartNode.transform,UICursor.instance.transform,args.StartNode.ParentNode.NodeColor,Color.green);
		activeDragNode = args.StartNode;
	}
Ejemplo n.º 3
0
	void InputGathered(NodeConnectionArgs args) {
		timer = 0f;
	}
Ejemplo n.º 4
0
	void EndLineDrag(NodeConnectionArgs args) {
		if(activeLine != null) {
			Destroy (activeLine.gameObject);
		}
	}