/// <summary>
    /// Tries to register.
    /// </summary>
    /// <param name="accountInfo">New account info.</param>
    /// <param name="callback">What to call when we are done.</param>
    /// <param name="phpScriptsLocation">Where the PHP scripts are located.</param>
    public static void TryToRegister(this AS_AccountInfo accountInfo, Action <string> callback, string phpScriptsLocation = null)
    {
        AS_CoroutineCaller caller = AS_CoroutineCaller.Create();

        caller.StartCoroutine(AS_Login.TryToRegister
                                  (accountInfo,
                                  value =>
        {
            caller.Destroy();
            callback(value);
        },
                                  phpScriptsLocation));
    }
    /// <summary>
    /// Tries to recover the password.
    /// </summary>
    /// <param name="email">Where to send the password recovery link.</param>
    /// <param name="callback">What to call when we are done.</param>
    /// <param name="phpScriptsLocation">Where the PHP scripts are located.</param>
    public static void TryToRecoverPassword(this string email, Action <string> callback, string phpScriptsLocation = null)
    {
        AS_CoroutineCaller caller = AS_CoroutineCaller.Create();

        caller.StartCoroutine(AS_Login.TryToRecoverPassword
                                  (email,
                                  value =>
        {
            caller.Destroy();
            callback(value);
        },
                                  phpScriptsLocation));
    }
    /// <summary>
    /// Tries to login.
    /// </summary>
    /// <param name="username">Username.</param>
    /// <param name="password">Password.</param>
    /// <param name="callback">What to call when we are done.</param>
    /// <param name="phpScriptsLocation">Where the PHP scripts are located.</param>
    public static void TryToLogin(this string username, string password, Action <string> callback, string phpScriptsLocation = null)
    {
        AS_CoroutineCaller caller = AS_CoroutineCaller.Create();

        caller.StartCoroutine(AS_Login.TryToLogin
                                  (username, password,
                                  value =>
        {
            caller.Destroy();
            callback(value);
        },
                                  phpScriptsLocation));
    }
    /// <summary>
    /// Tries to upload.
    /// </summary>
    /// <param name="accountInfo">What we're trying to upload.</param>
    /// <param name="accountId">Account identifier.</param>
    /// <param name="callback">What to call when we are done.</param>
    /// <param name="phpScriptsLocation">Where the PHP scripts are located.</param>
    public static void TryToUpload(this AS_AccountInfo accountInfo, int accountId, Action <string> callback, string phpScriptsLocation = null)
    {
        AS_CoroutineCaller caller = AS_CoroutineCaller.Create();

        caller.StartCoroutine(AS_AccountManagement.TryToUploadAccountInfoToDb
                                  (accountId,
                                  accountInfo,
                                  value =>
        {
            caller.Destroy();
            callback(value);
        },
                                  phpScriptsLocation));
    }
示例#5
0
 public static void Destroy(this AS_CoroutineCaller caller)
 {
     UnityEngine.Object.Destroy(caller.gameObject);
 }