diff --git a/Packages/com.vrchat.ClientSim/Runtime/System/ClientSimInteractiveLayerProvider.cs b/Packages/com.vrchat.ClientSim/Runtime/System/ClientSimInteractiveLayerProvider.cs index a4d20a8..4594530 100644 --- a/Packages/com.vrchat.ClientSim/Runtime/System/ClientSimInteractiveLayerProvider.cs +++ b/Packages/com.vrchat.ClientSim/Runtime/System/ClientSimInteractiveLayerProvider.cs @@ -1,5 +1,6 @@ using System; using UnityEngine; +using VRC.SDKBase; namespace VRC.SDK3.ClientSim { @@ -15,7 +16,9 @@ public class ClientSimInteractiveLayerProvider : IClientSimInteractiveLayerProvi private const int UI_LAYER = 5; private const int UI_MENU_LAYER = 12; private const int INTERNAL_UI_LAYER = 19; + private const int PLAYER_LOCAL_LAYER = 10; private const int MIRROR_REFLECTION_LAYER = 18; + private const int FIRST_USER_LAYER = 22; private readonly int _interactiveLayersDefault; private readonly int _interactiveLayersUI; @@ -28,8 +31,10 @@ public ClientSimInteractiveLayerProvider(IClientSimEventDispatcher eventDispatch { // Only the UI and UIMenu layers are interactable when the UI is open. _interactiveLayersUI = (1 << UI_LAYER) | (1 << UI_MENU_LAYER) | (1 << INTERNAL_UI_LAYER); - // When the menu is not open, all layers but UI, UIMenu, and MirrorReflection layers are interactable. - _interactiveLayersDefault = ~(1 << MIRROR_REFLECTION_LAYER) & ~_interactiveLayersUI; + // When the menu is not open, all layers but UI, UIMenu, PlayerLocal, and MirrorReflection layers are interactable. + _interactiveLayersDefault = ~(1 << UI_LAYER) & ~(1 << UI_MENU_LAYER) & ~(1 << PLAYER_LOCAL_LAYER) & ~(1 << MIRROR_REFLECTION_LAYER); + // If Interaction Passthrough is set, these User Layers will also be ignored. + _interactiveLayersDefault &= ~(VRC_SceneDescriptor.Instance.interactThruLayers << FIRST_USER_LAYER); _eventDispatcher = eventDispatcher; _eventDispatcher.Subscribe(SetMenuOpen);