示例#1
0
    //////////////////////////////////////////////////////////////////////
    public void OnExitTrigger(Collider localCollider, Collider externalCollider)
    {
        PortalTraveller traveller = externalCollider.GetComponentInParent <PortalTraveller>();

        if (!traveller || traveller.TravellerCollider != externalCollider)
        {
            return;
        }

        if (localCollider == _physZoneA)
        {
            traveller.OnLeavePortalZone(this);
        }
        else if (localCollider == _physZoneB)
        {
            traveller.OnLeavePortalZone(this);
        }
        else if (localCollider == _portalZone)
        {
            if (_trackedTravellers.Contains(traveller))
            {
                traveller.OnExitPortal();
            }
        }
    }