private void RenderUpload() { GUILayout.Label("4. Upload package", new GUILayoutOption[0]); bool enabled = GUI.enabled; if (string.IsNullOrEmpty(this.m_Package.Name) || string.IsNullOrEmpty(this.m_Package.VersionName) || this.m_AssetsState != AssetStorePackageController.AssetsState.None || string.IsNullOrEmpty(this.m_LocalRootPath) || !this.IsValidRelativeProjectFolder(this.m_LocalRootPath) || this.m_Package.Status != Package.PublishedStatus.Draft) { GUI.enabled = false; } if (GUILayout.Button((this.m_AssetsState != AssetStorePackageController.AssetsState.UploadingPackage) ? "Upload" : "Stop", new GUILayoutOption[] { GUILayout.Width(90f) })) { if (this.m_AssetsState == AssetStorePackageController.AssetsState.UploadingPackage) { AssetStoreClient.AbortLargeFilesUpload(); this.m_AssetsState = AssetStorePackageController.AssetsState.None; } else { this.Upload(); GUIUtility.ExitGUI(); } } GUI.enabled = enabled; }
public void OnClickUpload() { if (this.m_AssetsState != AssetStorePackageController.AssetsState.UploadingPackage) { this.Upload(); GUIUtility.ExitGUI(); } else { AssetStoreClient.AbortLargeFilesUpload(); this.m_AssetsState = AssetStorePackageController.AssetsState.None; } }
private void RenderAssetsFolderStatus() { if (this.m_AssetsState == AssetStorePackageController.AssetsState.UploadingPackage) { int num = (int)Mathf.Ceil(this.m_DraftAssetsUploadProgress * 100f); string str = num.ToString(); if (AssetStorePackageController.CancelableProgressBar(this.m_DraftAssetsUploadProgress, string.Concat("Uploading ", str, " %"), "Cancel")) { this.m_DraftAssetsUploadProgress = 0f; this.m_AssetsState = AssetStorePackageController.AssetsState.None; this.m_DraftAssetsPath = string.Empty; this.m_DraftAssetsSize = (long)0; AssetStoreClient.AbortLargeFilesUpload(); } } else if (this.m_AssetsState != AssetStorePackageController.AssetsState.BuildingPackage) { Color color = GUI.color; string str1 = "No assets selected"; if (this.m_LocalRootPath != null) { if (!this.IsValidRelativeProjectFolder(this.m_LocalRootPath)) { GUI.color = GUIUtil.ErrorColor; str1 = string.Format("The path \"{0}\" is not valid within this Project", this.m_LocalRootPath); } else if (!this.m_LocalRootPath.StartsWith("/AssetStoreTools")) { str1 = string.Concat(" ", this.m_LocalRootPath); } else { GUI.color = GUIUtil.ErrorColor; str1 = string.Format("The selected path cannot be part of \"/AssetStoreTools\" folder", this.m_LocalRootPath); } } GUILayout.Label(str1, new GUILayoutOption[0]); GUI.color = color; GUILayout.FlexibleSpace(); } else { GUILayout.Label(GUIUtil.StatusWheel, new GUILayoutOption[0]); GUILayout.Label("Please wait - building package", new GUILayoutOption[0]); GUILayout.FlexibleSpace(); } }
private void RenderMainAssetsStatus() { if (this.m_AssetsState == AssetStorePackageController.AssetsState.BuildingMainAssets) { GUILayout.Label(GUIUtil.StatusWheel, new GUILayoutOption[0]); GUILayout.Label("Please wait - building Main Assets", new GUILayoutOption[0]); GUILayout.FlexibleSpace(); } else if (this.m_AssetsState == AssetStorePackageController.AssetsState.UploadingMainAssets) { float num = (float)this.m_MainAssetsUploadHelper.GetProgress(); string str = Mathf.FloorToInt(num).ToString(); if (AssetStorePackageController.CancelableProgressBar(num, "Uploading " + str + " %", "Cancel")) { this.m_AssetsState = AssetStorePackageController.AssetsState.None; this.m_DraftAssetsPath = string.Empty; this.m_DraftAssetsSize = 0L; AssetStoreClient.AbortLargeFilesUpload(); } } else { string text; if (this.m_Package != null && !string.IsNullOrEmpty(this.m_LocalRootPath) && this.IsValidRelativeProjectFolder(this.m_LocalRootPath)) { if (this.m_MainAssets.Count == 0) { text = "No Files Selected"; } else if (this.m_MainAssets.Count == 1) { text = this.m_MainAssets[0] + " selected"; } else { text = this.m_MainAssets.Count + " File(s) selected"; } } else { text = "Please select a valid Assets folder"; } GUILayout.Label(text, new GUILayoutOption[0]); } }
private void RenderAssetsFolderStatus() { if (this.m_AssetsState == AssetStorePackageController.AssetsState.UploadingPackage) { string str = ((int)Mathf.Ceil(this.m_DraftAssetsUploadProgress * 100f)).ToString(); if (AssetStorePackageController.CancelableProgressBar(this.m_DraftAssetsUploadProgress, "Uploading " + str + " %", "Cancel")) { this.m_DraftAssetsUploadProgress = 0f; this.m_AssetsState = AssetStorePackageController.AssetsState.None; this.m_DraftAssetsPath = string.Empty; this.m_DraftAssetsSize = 0L; AssetStoreClient.AbortLargeFilesUpload(); } } else if (this.m_AssetsState == AssetStorePackageController.AssetsState.BuildingPackage) { GUILayout.Label(GUIUtil.StatusWheel, new GUILayoutOption[0]); GUILayout.Label("Please wait - building package", new GUILayoutOption[0]); GUILayout.FlexibleSpace(); } else { Color color = GUI.color; string text = "No assets selected"; if (this.m_LocalRootPath != null) { if (!this.IsValidRelativeProjectFolder(this.m_LocalRootPath)) { GUI.color = Color.red; } text = " " + this.m_LocalRootPath; } GUILayout.Label(text, new GUILayoutOption[0]); GUI.color = color; GUILayout.FlexibleSpace(); } }