示例#1
0
    IEnumerator StartAuthentication_internal(boolFuncResult callback, int trialNumber)
    {
        _initInProgress = true;

        _drive              = new GoogleDrive();
        _drive.ClientID     = "251952116687-o29juik9i0qbl6ktpa0n97cavk8cvip4.apps.googleusercontent.com";
        _drive.ClientSecret = "0ZptNq9TwzL7enTtlRUOoZ3_";

        var authorization = _drive.Authorize();

        yield return(StartCoroutine(authorization));

        if (authorization.Current is Exception)
        {
                        #if UNITY_EDITOR
                        #endif
            Exception temp = (authorization.Current as Exception);
            string    res  = temp.ToString();

            if (res == "GoogleDrive+Exception: Invalid credential.")
            {
                callback(true, 1);
            }
            else
            {
                callback(false, 0);
            }
        }
        else
        {
                        #if UNITY_EDITOR
            Debug.Log("User Account: " + _drive.UserAccount);
                        #endif
            callback(true, 0);
        }

        _initInProgress = false;
    }
	IEnumerator StartAuthentication_internal(boolFuncResult callback ,int trialNumber){
		_initInProgress = true;

		_drive = new GoogleDrive();
		_drive.ClientID = "251952116687-o29juik9i0qbl6ktpa0n97cavk8cvip4.apps.googleusercontent.com";
		_drive.ClientSecret = "0ZptNq9TwzL7enTtlRUOoZ3_";

		var authorization = _drive.Authorize();
		yield return StartCoroutine(authorization);

		if (authorization.Current is Exception) {
			
			#if UNITY_EDITOR
			#endif
			Exception temp =(authorization.Current as Exception);
			string res = temp.ToString();
		
			if(res == "GoogleDrive+Exception: Invalid credential."){
					callback (true, 1);
				
			}else{
				callback (false,0);
			}
				
		}else {
			#if UNITY_EDITOR
			Debug.Log("User Account: " + _drive.UserAccount);	
			#endif
			callback (true,0);
		}
			
		_initInProgress = false;
	}