public void PlugTo(IPlugOut port) { if (CanPlug(port)) { if (IsPlugged()) { GetPluggedPort().UnplugFrom(this); } input = (InputAction)port; port.AddPlug(this); } }
//Input -> Component //Output -> Rigidbody public void PlugTo(IPlugOut port) { if (CanPlug(port)) { if (IsPlugged()) { GetPluggedPort().UnplugFrom(this); } plugged_port = (IOutputValue)port; if (typeof(T).IsAssignableFrom(((IOutputValue)port).valueType)) { get_filter = GetFilter.Action; } else if (((IOutputValue)port).valueType.CanConvert(typeof(T))) { get_filter = GetFilter.ActionWithConverter; } port.AddPlug(this); } }