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 ed2f1d7
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 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 @@ -75,6 +76,9 @@ override public void Init(GameObject rParent, string sText)
}
#endif // PASSTHROUGH_SUPPORTED

// Disable passthrough button if in room
if (MultiplayerManager.m_Instance.State == ConnectionState.IN_ROOM) DisablePassthroughButton();

//find the active lighting preset
TiltBrush.Environment rCurrentPreset = SceneSettings.m_Instance.GetDesiredPreset();
if (rCurrentPreset != null)
Expand Down Expand Up @@ -157,5 +161,19 @@ void OnDestroy()
{
SceneSettings.m_Instance.FadingToDesiredEnvironment -= OnFadingToDesiredEnvironment;
}

public void DisablePassthroughButton()
{
for (int i = 0; i < m_Environments.Count; i++)
{
if (m_Environments[i].m_Guid.ToString() == PASSTHROUGH_GUID)
{
BaseButton button = m_Icons[i]?.m_IconScript as BaseButton;
if (button != null) button.SetButtonAvailable(false);
break;
}
}
}

}
} // namespace TiltBrush

0 comments on commit ed2f1d7

Please sign in to comment.