public void AddExecutionInputPort(string name = null) { //TODO this should create an empty gameobject and port view should create its own UIelements var newport = new GameObject(); newport.AddComponent <ExecutionPortModel>(); // initialze the port newport.GetComponent <ExecutionPortModel>().init(this, ExecutionInputs.Count, PortModel.porttype.input, name); //hookup the ports listener to the nodes propertychanged event, and hook // handlers on the node back from the ports connection events this.PropertyChanged += newport.GetComponent <ExecutionPortModel>().NodePropertyChangeEventHandler; newport.GetComponent <ExecutionPortModel>().PortConnected += PortConnected; newport.GetComponent <ExecutionPortModel>().PortDisconnected += PortDisconnected; ExecutionInputs.Add(newport.GetComponent <ExecutionPortModel>()); }