Skip to content

Commit

Permalink
Disable passthrough in multiplayer
Browse files Browse the repository at this point in the history
  • Loading branch information
sbanca committed Dec 19, 2024
1 parent 66de97c commit 997dae2
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions Assets/Scripts/GUI/LightingPopUpWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
using UnityEngine;
using System.Collections.Generic;
using System.Linq;
using OpenBrush.Multiplayer;

namespace TiltBrush
{
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -157,5 +165,6 @@ void OnDestroy()
{
SceneSettings.m_Instance.FadingToDesiredEnvironment -= OnFadingToDesiredEnvironment;
}

}
} // namespace TiltBrush

0 comments on commit 997dae2

Please sign in to comment.