Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using UnityEngine;
using VRC.SDKBase;

namespace VRC.SDK3.ClientSim
{
Expand All @@ -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;
Expand All @@ -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<ClientSimMenuStateChangedEvent>(SetMenuOpen);
Expand Down
Loading