private void OnTriggerExit(Collider other)
 {
     if (hoveredPlate != null && hoveredPlate.gameObject == other.gameObject)
     {
         hoveredPlate = null;
     }
 }
        private void OnTriggerEnter(Collider other)
        {
            var probablyPlate = other.GetComponent <VirtualMagnetPlate>();

            if (probablyPlate != null)
            {
                hoveredPlate = probablyPlate;
            }
        }
        public void OnGrabStart()
        {
            ConnectedTo?.Disconnect();
            OnDisconnected();
            ConnectedTo  = null;
            hoveredPlate = null;

            foreach (var collider in this.GetComponents <Collider>())
            {
                collider.isTrigger = true;
            }
        }
        public void OnGrabEnd()
        {
            if (hoveredPlate != null && hoveredPlate.IsAvailable())
            {
                ConnectedTo = hoveredPlate;
                ConnectedTo.Connect(this);
                hoveredPlate = null;
                OnConnected();
            }

            foreach (var collider in this.GetComponents <Collider>())
            {
                collider.isTrigger = false;
            }
        }