public bool IsInMiniWorld(Transform rayOrigin) { foreach (var miniWorld in m_Worlds) { var rayOriginPosition = rayOrigin.position; var pointerPosition = rayOriginPosition + rayOrigin.forward * m_DirectSelectionModule.GetPointerLength(rayOrigin); if (miniWorld.Contains(rayOriginPosition) || miniWorld.Contains(pointerPosition)) { return(true); } } return(false); }
bool Overlaps(Transform rayOrigin, Collider trigger) { var radius = m_DirectSelectionModule.GetPointerLength(rayOrigin); var totalColliders = Physics.OverlapSphereNonAlloc(rayOrigin.position, radius, s_CachedColliders, -1, QueryTriggerInteraction.Collide); for (var colliderIndex = 0; colliderIndex < totalColliders; colliderIndex++) { if (s_CachedColliders[colliderIndex] == trigger) { return(true); } } return(false); }