internal DownloadConfig([NotNull] string host, [NotNull] string unityVersion, int resourceVersion, bool isLatest, UnityMobilePlatform platform, [NotNull] string manifestAssetName) { Host = host; UnityVersion = unityVersion; ResourceVersion = resourceVersion; IsLatest = isLatest; Platform = platform; ManifestAssetName = manifestAssetName; }
private static string GetPlatformName(UnityMobilePlatform platform) { switch (platform) { case UnityMobilePlatform.Android: return("Android"); case UnityMobilePlatform.iOS: return("iOS"); default: throw new ArgumentOutOfRangeException(nameof(platform), platform, null); } }
public static string ToStringFast(this UnityMobilePlatform platform) { switch (platform) { case UnityMobilePlatform.Unknown: return("Unknown"); case UnityMobilePlatform.Android: return("Android"); case UnityMobilePlatform.iOS: return("iOS"); default: throw new ArgumentOutOfRangeException(nameof(platform), platform, null); } }
public static string AssetUrl([NotNull] string host, [NotNull] string unityVersion, UnityMobilePlatform platform, int resourceVersion, [NotNull] string assetName) { var platformName = GetPlatformName(platform); var assetPath = $"/production/{unityVersion}/{platformName}/{assetName}"; var assetUrl = $"https://{host}/{resourceVersion.ToString()}{assetPath}"; return(assetUrl); }