Exemple #1
0
    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);
                }
            }
        }
    }
Exemple #2
0
    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);
                }
            }
        }
    }