11using System ;
22using UnityEngine ;
3+ using VRC . SDKBase ;
34
45namespace VRC . SDK3 . ClientSim
56{
@@ -15,7 +16,9 @@ public class ClientSimInteractiveLayerProvider : IClientSimInteractiveLayerProvi
1516 private const int UI_LAYER = 5 ;
1617 private const int UI_MENU_LAYER = 12 ;
1718 private const int INTERNAL_UI_LAYER = 19 ;
19+ private const int PLAYER_LOCAL_LAYER = 10 ;
1820 private const int MIRROR_REFLECTION_LAYER = 18 ;
21+ private const int FIRST_USER_LAYER = 22 ;
1922
2023 private readonly int _interactiveLayersDefault ;
2124 private readonly int _interactiveLayersUI ;
@@ -28,8 +31,10 @@ public ClientSimInteractiveLayerProvider(IClientSimEventDispatcher eventDispatch
2831 {
2932 // Only the UI and UIMenu layers are interactable when the UI is open.
3033 _interactiveLayersUI = ( 1 << UI_LAYER ) | ( 1 << UI_MENU_LAYER ) | ( 1 << INTERNAL_UI_LAYER ) ;
31- // When the menu is not open, all layers but UI, UIMenu, and MirrorReflection layers are interactable.
32- _interactiveLayersDefault = ~ ( 1 << MIRROR_REFLECTION_LAYER ) & ~ _interactiveLayersUI ;
34+ // When the menu is not open, all layers but UI, UIMenu, PlayerLocal, and MirrorReflection layers are interactable.
35+ _interactiveLayersDefault = ~ ( 1 << UI_LAYER ) & ~ ( 1 << UI_MENU_LAYER ) & ~ ( 1 << PLAYER_LOCAL_LAYER ) & ~ ( 1 << MIRROR_REFLECTION_LAYER ) ;
36+ // If Interaction Passthrough is set, these User Layers will also be ignored.
37+ _interactiveLayersDefault &= ~ ( VRC_SceneDescriptor . Instance . interactThruLayers << FIRST_USER_LAYER ) ;
3338
3439 _eventDispatcher = eventDispatcher ;
3540 _eventDispatcher . Subscribe < ClientSimMenuStateChangedEvent > ( SetMenuOpen ) ;
0 commit comments