forked from Unity-Technologies/UnityCsReference
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AssetStoreUtils.bindings.cs
41 lines (35 loc) · 1.75 KB
/
AssetStoreUtils.bindings.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Unity C# reference source
// Copyright (c) Unity Technologies. For terms of use, see
// https://unity3d.com/legal/licenses/Unity_Reference_Only_License
using System.Runtime.InteropServices;
using UnityEngine;
using UnityEngine.Bindings;
namespace UnityEditor
{
[NativeHeader("Editor/Mono/AssetStore.bindings.h")]
[StaticAccessor("AssetStoreScriptBindings", StaticAccessorType.DoubleColon)]
internal class AssetStoreUtils
{
private const string kAssetStoreUrl = "https://shawarma.unity3d.com";
public delegate void DownloadDoneCallback(string package_id, string message, int bytes, int total);
extern public static void Download(string id, string url, string[] destination, string key, string jsonData, bool resumeOK, DownloadDoneCallback doneCallback = null);
extern public static string CheckDownload(string id, string url, string[] destination, string key);
extern public static bool AbortDownload(string id, string[] destination);
extern public static void RegisterDownloadDelegate([NotNull] ScriptableObject d);
extern public static void UnRegisterDownloadDelegate([NotNull] ScriptableObject d);
extern public static string GetLoaderPath();
extern public static void UpdatePreloading();
public static string GetOfflinePath()
{
return System.Uri.EscapeUriString(EditorApplication.applicationContentsPath + "/Resources/offline.html");
}
public static string GetAssetStoreUrl()
{
return kAssetStoreUrl;
}
public static string GetAssetStoreSearchUrl()
{
return GetAssetStoreUrl().Replace("https", "http"); // Use use http (and not https) when searching because its faster
}
}
}