Пример #1
0
        //----- params -----

        //----- field -----

        //----- property -----

        //----- method -----

        public static async Task <bool> Upload(S3Uploader uploader)
        {
            var exportPath = BuildManager.GetExportPath();

            if (string.IsNullOrEmpty(exportPath))
            {
                return(false);
            }

            var platformName = PlatformUtility.GetPlatformTypeName();

            var sw = System.Diagnostics.Stopwatch.StartNew();

            var result = await uploader.Execute(exportPath, platformName);

            sw.Stop();

            var success = !string.IsNullOrEmpty(result);

            using (new DisableStackTraceScope())
            {
                if (success)
                {
                    Debug.LogFormat("Upload Complete. ({0:F2}sec)\n\nVersion : {1}", sw.Elapsed.TotalSeconds, result);
                }
                else
                {
                    Debug.LogError("Upload Failed.");
                }
            }

            return(success);
        }
Пример #2
0
        public string BuildDownloadUrl(AssetInfo assetInfo)
        {
            var platformName = PlatformUtility.GetPlatformTypeName();

            var url = PathUtility.Combine(new string[] { remoteUrl, platformName, versionHash, assetInfo.FileName });

            return(string.Format("{0}?v={1}", url, assetInfo.Hash));
        }
Пример #3
0
        private string BuildDownloadUrl(AssetInfo assetInfo)
        {
            var platformName = PlatformUtility.GetPlatformTypeName();

            var url = PathUtility.Combine(new string[] { remoteUrl, platformName, versionHash, assetInfo.FileName });

            var downloadUrl = string.Format("{0}{1}", url, PackageExtension);

            if (!assetInfo.Hash.IsNullOrEmpty())
            {
                downloadUrl = string.Format("{0}?v={1}", downloadUrl, assetInfo.Hash);
            }

            return(downloadUrl);
        }
Пример #4
0
        public string GetAssetBundleOutputPath()
        {
            var projectPath = UnityPathUtility.GetProjectFolderPath();
            var folderName  = PlatformUtility.GetPlatformTypeName();

            var paths = new string[] { projectPath, UnityPathUtility.LibraryFolder, AssetBundleCacheFolder, folderName };

            var assetBundlePath = PathUtility.Combine(paths);

            if (!Directory.Exists(assetBundlePath))
            {
                Directory.CreateDirectory(assetBundlePath);
            }

            return(assetBundlePath);
        }
Пример #5
0
        public static string GetExportPath()
        {
            var config = ManageConfig.Instance;

            var exportDirectory = config.ExportDirectory;

            if (string.IsNullOrEmpty(exportDirectory))
            {
                return(null);
            }

            var platformFolderName = PlatformUtility.GetPlatformTypeName();

            var paths = new string[] { exportDirectory, ExportFolderName, platformFolderName };

            return(PathUtility.Combine(paths) + PathUtility.PathSeparator);
        }