This commit is contained in:
CortexCore
2023-10-24 23:38:22 +08:00
parent 2c4710bc5d
commit bd40165ade
152 changed files with 3681 additions and 1531 deletions

View File

@@ -5,17 +5,16 @@ using System.Linq;
using MonKey;
using UnityEditor;
using UnityEngine;
namespace BITKit
{
public partial class BITMonkeyCommands
{
[Command(nameof(ExportPrefabPreview), "导出已选的预制预览图", QuickName = "exp"), MenuItem("Tools/Instance Material")]
[Command(nameof(ExportPrefabPreview), "导出已选的预制预览图", QuickName = "exp"), MenuItem("Tools/Export Selected Prefab Preview")]
private static void ExportPrefabPreview()
{
var exportPath = Path.Combine(Application.dataPath, "Temps");
PathHelper.EnsureDirectoryCreated(exportPath);
foreach (var image in Selection.objects.Select(AssetPreview.GetAssetPreview))
foreach (var image in UnityEditor.Selection.objects.Select(AssetPreview.GetAssetPreview))
{
var path = Path.Combine(exportPath, GUID.Generate() + ".png");
File.WriteAllBytes( path, image.EncodeToPNG());