Skip to content

fix: IP window button #538

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 10, 2022
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions Assets/BossRoom/Scenes/MainMenu.unity
Git LFS file not shown
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class ClientMainMenuState : GameStateBehaviour

[SerializeField] NameGenerationData m_NameGenerationData;
[SerializeField] LobbyUIMediator m_LobbyUIMediator;
[SerializeField] IPUIMediator m_IPUIMediator;

[SerializeField] CanvasGroup m_MainMenuButtonsCanvasGroup;
[SerializeField] GameObject m_SignInSpinner;
Expand All @@ -47,6 +48,7 @@ void InjectDependenciesAndInitialize(AuthenticationServiceFacade authServiceFaca

m_Scope.BindInstanceAsSingle(m_NameGenerationData);
m_Scope.BindInstanceAsSingle(m_LobbyUIMediator);
m_Scope.BindInstanceAsSingle(m_IPUIMediator);

var unityAuthenticationInitOptions = new InitializationOptions();

Expand Down Expand Up @@ -115,5 +117,11 @@ public void OnStartClicked()
m_LobbyUIMediator.ToggleJoinLobbyUI();
m_LobbyUIMediator.Show();
}

public void OnDirectIPClicked()
{
m_LobbyUIMediator.Hide();
m_IPUIMediator.Show();
}
}
}
18 changes: 1 addition & 17 deletions Assets/BossRoom/Scripts/Client/UI/IPUIMediator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class IPUIMediator : MonoBehaviour
[SerializeField] UITinter m_JoinTabButtonBorderTinter;

[SerializeField] UITinter m_HostTabButtonTinter;

[SerializeField] UITinter m_HostTabButtonBorderTinter;

[SerializeField] GameObject m_SignInSpinner;
Expand Down Expand Up @@ -63,22 +63,6 @@ void Start()
ToggleCreateIPUI();
}

void Update()
{
if (Input.touchCount == k_NbTouchesToOpenWindow && AnyTouchDown() ||
m_OpenIPWindowKeyCode != KeyCode.None && Input.GetKeyDown(m_OpenIPWindowKeyCode))
{
if (m_CanvasGroup.interactable)
{
Hide();
}
else
{
Show();
}
}
}

static bool AnyTouchDown()
{
foreach (var touch in Input.touches)
Expand Down