diff --git a/Assets/Scripts/GUI/LightingPopUpWindow.cs b/Assets/Scripts/GUI/LightingPopUpWindow.cs index 61be8830d..b05d5c932 100644 --- a/Assets/Scripts/GUI/LightingPopUpWindow.cs +++ b/Assets/Scripts/GUI/LightingPopUpWindow.cs @@ -23,6 +23,7 @@ using UnityEngine; using System.Collections.Generic; using System.Linq; +using OpenBrush.Multiplayer; namespace TiltBrush { @@ -64,17 +65,11 @@ override public void Init(GameObject rParent, string sText) // Remove passthrough scene for devices that don't support it #if !PASSTHROUGH_SUPPORTED - foreach (var env in m_Environments) - { - // Passthrough - if (env.m_Guid.ToString() == PASSTHROUGH_GUID) - { - m_Environments.Remove(env); - break; - } - } -#endif // PASSTHROUGH_SUPPORTED - + RemovePassthrough(); +#else // PASSTHROUGH_SUPPORTED + // Remove passthrough if multiplayer connected + if (MultiplayerManager.m_Instance.State == ConnectionState.IN_ROOM) RemovePassthrough(); +#endif //find the active lighting preset TiltBrush.Environment rCurrentPreset = SceneSettings.m_Instance.GetDesiredPreset(); if (rCurrentPreset != null) @@ -106,6 +101,19 @@ override public void Init(GameObject rParent, string sText) base.Init(rParent, sText); } + public void RemovePassthrough() + { + foreach (var env in m_Environments) + { + // Passthrough + if (env.m_Guid.ToString() == PASSTHROUGH_GUID) + { + m_Environments.Remove(env); + break; + } + } + } + public void HandleCanvasLockToggle() { SketchControlsScript.m_Instance.m_DisableWorldGrabbing = m_WorldLockToggle.IsToggledOn; @@ -157,5 +165,6 @@ void OnDestroy() { SceneSettings.m_Instance.FadingToDesiredEnvironment -= OnFadingToDesiredEnvironment; } + } } // namespace TiltBrush