public void AddConnection(PortModel start, PortModel end) { var realConnector = new GameObject("Connector"); if (end.GetType() == typeof(ExecutionPortModel)) { realConnector.AddComponent <ExecutionConnectorModel>(); } else { realConnector.AddComponent <ConnectorModel>(); } //TODO fix logic so that we reoder the inputs correctly... outputs should go first, then inputs are the end, can just check types realConnector.GetComponent <ConnectorModel>().init(start, end); end.Connect(realConnector.GetComponent <ConnectorModel>()); Connectors.Add(realConnector.GetComponent <ConnectorModel>()); }