private static async void Switch(string url) { await VCCommands.Instance.SwitchBranchTask(url); AssetDatabaseRefreshManager.RequestAssetDatabaseRefresh(); Refresh(); }
private void OnEnable() { AssetDatabaseRefreshManager.PauseAssetDatabaseRefresh(); minSize = new Vector2(1000, 400); position = new Rect { xMin = Screen.width * 0.5f - this.minSize.x, yMin = Screen.height * 0.5f - this.minSize.y, width = this.minSize.x, height = this.minSize.y }; commitMessageHeight = EditorPrefs.GetFloat("VCCommitWindow/commitMessageHeight", 140.0f); rect = new Rect(0, commitMessageHeight, position.width, 10.0f); vcMultiColumnAssetList = new VCMultiColumnAssetList(Repaint, VCSettings.SelectiveCommit); VCCommands.Instance.StatusCompleted += RefreshSelection; }
private static async void Merge(string url) { int progressCounter = 0; void UpdateMergeProgress(string s) { EditorUtility.DisplayProgressBar("Merge", s, ((progressCounter++ % 25) / 25f)); } VCCommands.Instance.ProgressInformation += UpdateMergeProgress; bool result = await VCCommands.Instance.MergeBranchTask(url); VCCommands.Instance.ProgressInformation -= UpdateMergeProgress; EditorUtility.ClearProgressBar(); if (result) { await VCCommands.Instance.StatusTask(StatusLevel.Local, DetailLevel.Normal); VCCommands.Instance.CommitDialog(GetChangedAssets().Select(status => status.assetPath.Compose()).ToList(), includeDependencies: false, showUserConfirmation: true, commitMessage: $"Merged {url} to {currentBranch}"); AssetDatabaseRefreshManager.RequestAssetDatabaseRefresh(); } }
private void OnDisable() { EditorPrefs.SetFloat("VCCommitWindow/commitMessageHeight", commitMessageHeight); vcMultiColumnAssetList.Dispose(); AssetDatabaseRefreshManager.ResumeAssetDatabaseRefresh(); }