Exemple #1
0
 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;
 }
Exemple #2
0
        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);
            }
        }
Exemple #4
0
        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);
        }