void DoTheThing(SnapshotTool.SnapshotMode mode) { var currentTool = ToolsModifierControl.toolController.CurrentTool; SnapshotTool tool = ToolsModifierControl.SetTool <SnapshotTool>(); if (tool != null) { var crhelper = CoroutineHelper.Create(() => { tool.Mode = mode; int w = 644; int h = 360; if (mode == SnapshotTool.SnapshotMode.Thumbnail) { w = AssetImporterThumbnails.thumbWidth; h = AssetImporterThumbnails.thumbHeight; } else if (mode == SnapshotTool.SnapshotMode.Infotooltip) { w = SnapshotTool.tooltipWidth; h = SnapshotTool.tooltipHeight; } tool.StartShot(w, h, () => { ToolsModifierControl.toolController.CurrentTool = currentTool; Debug.Log("Snapshot taken"); }); }); crhelper.Run(0.5f); } }
public static void Postfix() { CreateBlueprintTool.DestroyInstance(); UseBlueprintTool.DestroyInstance(); SnapshotTool.DestroyInstance(); MultiToolParameterMenu.DestroyInstance(); BlueprintsAssets.BLUEPRINTS_AUTOFILE_WATCHER.Dispose(); }
protected override void OnVisibilityChanged() { base.OnVisibilityChanged(); if (isVisible) { if (Singleton <LoadingManager> .exists) { Singleton <LoadingManager> .instance.autoSaveTimer.Pause(); } m_snapshotContainer.relativePosition = new Vector3(WIDTH - m_snapshotContainer.width - 20, 100); SnapshotTool tool = ToolsModifierControl.GetTool <SnapshotTool>(); if (tool != null) { string snapShotPath = tool.snapShotPath; if (!string.IsNullOrEmpty(snapShotPath)) { for (int i = 0; i < m_extensions.Length; i++) { m_fSReporter[i] = new FileSystemReporter("*" + m_extensions[i], snapShotPath, new FileSystemReporter.ReporterEventHandler(Refresh)); if (m_fSReporter[i] != null) { m_fSReporter[i].Start(); } } } } Refresh(); } else { if (Singleton <LoadingManager> .exists) { Singleton <LoadingManager> .instance.autoSaveTimer.UnPause(); } for (int j = 0; j < m_extensions.Length; j++) { if (m_fSReporter[j] != null) { m_fSReporter[j].Stop(); m_fSReporter[j].Dispose(); m_fSReporter[j] = null; } } } }
private void FetchSnapshots() { string b = (m_snapshotPaths.Count <= 0) ? null : m_snapshotPaths[m_currentSnapshot]; m_currentSnapshot = 0; m_snapshotPaths.Clear(); SnapshotTool tool = ToolsModifierControl.GetTool <SnapshotTool>(); if (tool != null) { string snapShotPath = tool.snapShotPath; if (snapShotPath != null) { FileInfo[] fileInfo = SaveHelper.GetFileInfo(snapShotPath); if (fileInfo != null) { FileInfo[] array = fileInfo; for (int i = 0; i < array.Length; i++) { FileInfo fileInfo2 = array[i]; if (string.Compare(Path.GetExtension(fileInfo2.Name), ".png", StringComparison.OrdinalIgnoreCase) == 0) { if (Path.GetFileName(fileInfo2.Name).Contains("snapshot")) { m_snapshotPaths.Add(fileInfo2.FullName); if (fileInfo2.FullName == b) { m_currentSnapshot = m_snapshotPaths.Count - 1; } } } } } UIComponent prevButton = Find("Previous"); bool isEnabled = m_snapshotPaths.Count > 1; Find("Next").isEnabled = isEnabled; prevButton.isEnabled = isEnabled; RefreshSnapshot(); } } }
public static void Postfix() { CreateBlueprintTool.DestroyInstance(); UseBlueprintTool.DestroyInstance(); SnapshotTool.DestroyInstance(); }