public void OnGuestMode()
    {
        currentLogInState = LogInState.Guest;

        canvas_General.enabled = false;
        canvas_LogIn.enabled   = false;
        canvas_SignUp.enabled  = false;
        canvas_Guest.enabled   = true;
    }
    public void OnLogInMode()
    {
        currentLogInState = LogInState.LogIn;

        canvas_General.enabled = true;
        canvas_LogIn.enabled   = true;
        canvas_SignUp.enabled  = false;
        canvas_Guest.enabled   = false;

        inputField_Mail.text = string.Empty;
    }
        public void Update()
        {
            if (m_startingRendezVous)
            {
                StartUpState startUpState = (StartUpState)RendezVousInvokes.LegacyRendezVousGetStartUpState();
                if (startUpState == StartUpState.SUCCESSFUL)
                {
                    m_startingRendezVous = false;
                    String userName = GetUserName();
                    String password = GetPassword();
                    GetCDKeyList();
                    if (m_keys.Count > 0)
                    {
                        RendezVousInvokes.LegacyRendezVousLogIn(userName, password, m_keys[0]);
                        m_connectingToRendezVous = true;
                        m_unlockingKeyNr         = -1;
                    }
                }
                else if (startUpState == StartUpState.FAILURE)
                {
                    m_startingRendezVous = false;
                    m_isOfflineMode      = true;
                }
            }
            if (m_connectingToRendezVous)
            {
                if (m_unlockingKeyNr == -1)
                {
                    LogInState logInState = (LogInState)RendezVousInvokes.LegacyRendezVousGetLogInState();
                    if (logInState == LogInState.SUCCESSFUL)
                    {
                        m_unlockingKeyNr = 0;
                        RendezVousInvokes.LegacyRendezVousActivateAnyKey(m_keys[m_unlockingKeyNr]);
                    }
                    else if (logInState == LogInState.FAILURE)
                    {
                        m_isOfflineMode          = true;
                        m_connectingToRendezVous = false;
                    }
                }
                else
                {
                    EActivateKeyResult unlockPrivilegeState = GetUnlockPrivilegeState();
                    if (unlockPrivilegeState != EActivateKeyResult.ACTIVATE_WAITING)
                    {
                        m_unlockingKeyNr++;
                        if (m_unlockingKeyNr < m_keys.Count)
                        {
                            RendezVousInvokes.LegacyRendezVousActivateAnyKey(m_keys[m_unlockingKeyNr]);
                        }
                        else
                        {
                            DoneLogin();
                        }
                    }
                }
            }
            if (m_isSettingAction)
            {
                SetActionState setActionState = (SetActionState)RendezVousInvokes.LegacyRendezVousGetActionsState();
                if (setActionState == SetActionState.SUCCESSFUL)
                {
                    if (OnActionCompleted != null && m_settingActionID >= 0)
                    {
                        ActionCompletedEventArgs e = new ActionCompletedEventArgs(m_settingActionID, true);
                        OnActionCompleted(this, e);
                    }
                    m_isSettingAction = false;
                    m_settingActionID = -1;
                }
                else if (setActionState == SetActionState.FAILURE)
                {
                    if (OnActionCompleted != null && m_settingActionID >= 0)
                    {
                        ActionCompletedEventArgs e2 = new ActionCompletedEventArgs(m_settingActionID, false);
                        OnActionCompleted(this, e2);
                    }
                    m_isSettingAction = false;
                    m_settingActionID = -1;
                }
            }
            List <IntPtr> list = new List <IntPtr>();

            foreach (IntPtr intPtr in overlappedMap.Keys)
            {
                if (UplayInvokes.UPLAY_HasOverlappedOperationCompleted(intPtr))
                {
                    list.Add(intPtr);
                }
            }
            foreach (IntPtr intPtr2 in list)
            {
                overlappedMap.Remove(intPtr2);
                Marshal.FreeHGlobal(intPtr2);
            }
            list.Clear();
            if (UplayInvokes.UPLAY_Update() == 0)
            {
                m_isForceQuit = true;
            }
            UPLAY_Event uplay_Event;

            while (UplayInvokes.UPLAY_GetNextEvent(out uplay_Event))
            {
                Debug.Log("Received uplay Event! : " + uplay_Event.type);
                if (uplay_Event.type == UPLAY_EventType.UPLAY_Event_UserAccountSharing)
                {
                    m_isRendezVousConnected = false;
                    m_isOfflineMode         = true;
                }
            }
        }