1
This commit is contained in:
@@ -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());
|
||||
|
Reference in New Issue
Block a user