private void SwitchToLoginPanel() { FailedToLoginText.SetActive(false); PleaseLoginWithFacebookText.SetActive(false); ConnectingText.SetActive(false); loginPanel.SetActive(true); mainMenuPanel.SetActive(false); NetworkDatabase.NDB.OnLoggedIn += () => { shouldSwitch = true; return true; }; }
public void LoginClicked() { FailedToLoginText.SetActive(false); PleaseLoginWithFacebookText.SetActive(false); ConnectingText.SetActive(true); new Thread(delegate () { if (NetworkDatabase.NDB.TryLogin()) sucessConnect = true; else failedConnect = true; }).Start(); }
private void Update() { if (shouldSwitch) { loginPanel.SetActive(false); mainMenuPanel.SetActive(true); shouldSwitch = false; } if (failedConnect) { ConnectingText.SetActive(false); FailedToLoginText.SetActive(true); failedConnect = false; } if (sucessConnect) { ConnectingText.SetActive(false); PleaseLoginWithFacebookText.SetActive(true); sucessConnect = false; } if (logout) { LogoutClicked(); logout = false; } }