コード例 #1
0
        public List <AssetstoreContentWrapper> GetAssetsInfo(List <int> ids)
        {
            List <AssetstoreContentWrapper> data = new List <AssetstoreContentWrapper>();

            foreach (int id in ids)
            {
                data.Add(UnityAssetstoreRequest.GetResponseToJson <AssetstoreContentWrapper>
                             (string.Format(ASSET_USER_OVERVIEW_URL, id), "*/*", "", ""));
            }

            return(data);
        }
コード例 #2
0
        public async Task <byte[]> GetDownloadAssetTaskAsync(int id)
        {
            JObject assets = JObject.FromObject(UnityAssetstoreRequest.GetResponseToJson
                                                    (string.Format(ASSET_DOWNLOAD_URL, id), "*/*", "", "", "GET", ""));

            downloadInfo = assets["download"].ToObject <AssetstoreDownloadInfoWrapper>();

            using (WebClient wc = new WebClient())
            {
                wc.DownloadDataCompleted += DownloadDataCompleted;
                return(await wc.DownloadDataTaskAsync(new Uri(downloadInfo.URL)));
            }
        }
コード例 #3
0
        public List <int> GetDownloadableAssets()
        {
            List <int> assetsId = new List <int>();
            JObject    assets   = JObject.FromObject(UnityAssetstoreRequest.GetResponseToJson
                                                         (SEARCH_URL, "*/*", "application/x-www-form-urlencoded; charset=UTF-8", "", "POST", ""));

            foreach (JToken asset in assets["results"].Children())
            {
                assetsId.Add(asset["id"].Value <int>());
            }

            return(assetsId);
        }
コード例 #4
0
        public AssetstoreUserWrapper UserLogin(string id, string password)
        {
            string loginParameter = string.Format(
                "license_hash=&hardware_hash=&language_code=kr&current_package_id=&user={0}&pass={1}",
                HttpUtility.UrlEncode(id),
                HttpUtility.UrlEncode(password));

            userAuthenticate = UnityAssetstoreRequest.GetResponseToJson <AssetstoreUserWrapper>
                                   (USER_LOGIN_URL,
                                   "application/json",
                                   "application/x-www-form-urlencoded; charset=UTF-8",
                                   "", "POST", loginParameter);

            UnityAssetstoreRequest.KharmaVersion = userAuthenticate.KharmaVersion;
            UnityAssetstoreRequest.UnitySession  = userAuthenticate.XUnitySession;

            return(userAuthenticate);
        }
コード例 #5
0
 public AssetstoreContentWrapper GetAssetInfo(int id)
 {
     return(UnityAssetstoreRequest.GetResponseToJson <AssetstoreContentWrapper>
                (string.Format(ASSET_OVERVIEW_URL, id), "*/*", "", ""));
 }
コード例 #6
0
 public AssetstoreUserOverviewWrapper GetUserOverview(string id)
 {
     return(UnityAssetstoreRequest.GetResponseToJson <AssetstoreUserOverviewWrapper>
                (string.Format(USER_OVERVIEW_URL, id), "*/*", "", ""));;
 }