public void AddConnection(TCPConnection connection) { DisplayedConnectionHandle handle = new DisplayedConnectionHandle(); handle.connection = connection; handle.display = Instantiate(connectionDisplayPrefab, transform).GetComponent <ConnectionDisplay>(); handle.display.Init(connection); handles.Add(handle); }
public void RemoveConnection(TCPConnection connection) { DisplayedConnectionHandle handle = GetConnectionHandle(connection); if (handle != null) { Destroy(handle.display.gameObject); handles.Remove(handle); } }