private void OnTriggerExit(Collider other) { ConnectorSlot otherSlot; if (other.TryGetComponent(out otherSlot)) { Debug.Log($"collided with other slot"); if (otherSlot.type == type) { Debug.Log("uncollided"); stillCollidingWithSameType = false; outerSlot = null; SetConnected(false); foreach (var innerSlot in innerSlots) { innerSlot.SetConnected(false); } } } }
private void OnTriggerEnter(Collider other) { ConnectorSlot otherSlot; Debug.Log("some collision"); if (other.TryGetComponent(out otherSlot)) { Debug.Log($"collided with other slot"); if (otherSlot.type == type) { Debug.Log($"SAME TYPE!"); stillCollidingWithSameType = true; outerSlot = otherSlot; SetConnected(true); foreach (var innerSlot in innerSlots) { innerSlot.SetConnected(true); } } } }