using System; using System.Collections; using System.Collections.Generic; using UnityEngine; public class Connector : MonoBehaviour { public Connectable Connected { get; private set; } public Transform ConnectionPoint; public void Connect(Connectable conn) { Connected = conn; } public void Disconnect(Connectable conn) { if (conn != Connected) throw new InvalidOperationException("Wrong object disconnected"); Connected = null; } }