public IEnumerator GetAccountByUserName(string userName, Result <AccountInfo> result) { Result <StorageAccountInfo> r = new Result <StorageAccountInfo>(this); yield return(StartCoroutine(storage.GetAccountByUserName(userName, r))); var user = r.Value; result.SetValue(new AccountInfo(user.userID, user.userName, user.data)); }