Beispiel #1
0
    /// <summary>
    /// When the corresponding button is clicked, login the gamer with a previously created account.
    /// </summary>
    public void Button_LoginWithCredentials()
    {
        // Default hardcoded values to use if no InputField elements references are assigned
        string gamerID     = null;
        string gamerSecret = null;

        // Check the gamerID value
        if (loginWithCredentials_GamerID == null)
        {
            Debug.LogWarning(string.Format(noReferenceFormat, "Login", "loginWithCredentials_GamerID"));
        }
        else if (!string.IsNullOrEmpty(loginWithCredentials_GamerID.text))
        {
            gamerID = loginWithCredentials_GamerID.text;
        }

        // Check the gamerSecret value
        if (loginWithCredentials_GamerSecret == null)
        {
            Debug.LogWarning(string.Format(noReferenceFormat, "Login", "loginWithCredentials_GamerSecret"));
        }
        else if (!string.IsNullOrEmpty(loginWithCredentials_GamerSecret.text))
        {
            gamerSecret = loginWithCredentials_GamerSecret.text;
        }

        // Call the template method
        LoginFeatures.Handling_LoginWithCredentials(gamerID, gamerSecret);
    }