public static void GetMetaData(AssetStorePublisher account, PackageDataSource packageDataSource, AssetStoreAPI.DoneCallback callback) { AssetStoreClient.CreatePendingGet("metadata", "/metadata/0", delegate(AssetStoreResponse res) { DebugUtils.Log(res.data); string errorMessage; JSONValue jval; bool flag = AssetStoreAPI.Parse(res, out errorMessage, out jval); if (flag && !jval.ContainsKey("error_fields")) { callback(errorMessage); return; } string str = "none"; try { str = "account"; string text = AssetStoreAPI.OnAssetStorePublisher(jval, account, packageDataSource); if (text != null) { callback(text); return; } } catch (JSONTypeException ex) { callback("Malformed metadata response from server: " + str + " - " + ex.Message); } catch (KeyNotFoundException ex2) { callback("Malformed metadata response from server. " + str + " - " + ex2.Message); } callback(null); }); }
public static void UploadAssets(Package package, string newGUID, string newRootPath, string newProjectpath, string filepath, AssetStoreAPI.DoneCallback callback, AssetStoreClient.ProgressCallback progress) { string path = string.Format("/package/{0}/unitypackage", package.versionId); AssetStoreClient.UploadLargeFile(path, filepath, new Dictionary <string, string> { { "root_guid", newGUID }, { "root_path", newRootPath }, { "project_path", newProjectpath } }, delegate(AssetStoreResponse resp) { if (resp.HttpStatusCode == -2) { callback("aborted"); return; } string errorMessage = null; JSONValue jsonvalue; AssetStoreAPI.Parse(resp, out errorMessage, out jsonvalue); callback(errorMessage); }, progress); }
public static void UploadBundle(string path, string filepath, AssetStoreAPI.UploadBundleCallback callback, AssetStoreClient.ProgressCallback progress) { AssetStoreClient.UploadLargeFile(path, filepath, null, delegate(AssetStoreResponse resp) { string errorMessage = null; JSONValue jsonvalue; AssetStoreAPI.Parse(resp, out errorMessage, out jsonvalue); callback(filepath, errorMessage); }, progress); }
private static void Upload(string path, string filepath, AssetStoreAPI.DoneCallback callback, AssetStoreClient.ProgressCallback progress = null) { AssetStoreClient.Pending pending = AssetStoreClient.CreatePendingUpload(path, path, filepath, delegate(AssetStoreResponse resp) { string errorMessage = null; JSONValue jsonvalue; AssetStoreAPI.Parse(resp, out errorMessage, out jsonvalue); callback(errorMessage); }); pending.progressCallback = progress; }