MultipleEdit
This commit is contained in:
parent
aa167afb81
commit
0457d7d44c
8
Assets/AsmdefHelper/MultipleEdit.meta
Normal file
8
Assets/AsmdefHelper/MultipleEdit.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a9325e20a8831bf43b94e22a406c4e67
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
8
Assets/AsmdefHelper/MultipleEdit/Editor.meta
Normal file
8
Assets/AsmdefHelper/MultipleEdit/Editor.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 9a6f1c1bda271a541b230a51a05a677c
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"reference": "GUID:211243abc45174c45b3a6c275ea126b9"
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 43a16440f46e8054e8bb12c38f573975
|
||||||
|
AssemblyDefinitionReferenceImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -0,0 +1,70 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using UnityEditor;
|
||||||
|
using UnityEditor.Experimental.AssetImporters;
|
||||||
|
using UnityEditorInternal;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace AsmdefMultiEdit.Editor
|
||||||
|
{
|
||||||
|
public class AsmdefMultiEditWindow : EditorWindow
|
||||||
|
{
|
||||||
|
static IList<InspectorWindow> windows = new List<InspectorWindow>();
|
||||||
|
|
||||||
|
[MenuItem("Window/Asmdef Multiple Edit/1.Search asmdef in project")]
|
||||||
|
public static void Search()
|
||||||
|
{
|
||||||
|
var projectBrowser = GetWindow<ProjectBrowser>();
|
||||||
|
projectBrowser.SetSearch("t:AssemblyDefinitionAsset");
|
||||||
|
}
|
||||||
|
|
||||||
|
[MenuItem("Window/Asmdef Multiple Edit/2.Open selected asmdef inspector view")]
|
||||||
|
public static void Open()
|
||||||
|
{
|
||||||
|
var asmdefs = Selection.GetFiltered(typeof(AssemblyDefinitionAsset), SelectionMode.TopLevel);
|
||||||
|
if (!asmdefs.Any())
|
||||||
|
{
|
||||||
|
Debug.Log("no AssemblyDefinitionAsset");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
CloseWindows();
|
||||||
|
foreach (var adf in asmdefs)
|
||||||
|
{
|
||||||
|
Selection.objects = new[] { adf };
|
||||||
|
var w = CreateWindow<InspectorWindow>();
|
||||||
|
// LockすることでInspectorWindowの表示を固定する
|
||||||
|
w.isLocked = true;
|
||||||
|
windows.Add(w);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[MenuItem("Window/Asmdef Multiple Edit/3.All apply and close")]
|
||||||
|
public static void Apply()
|
||||||
|
{
|
||||||
|
foreach (var w in windows)
|
||||||
|
{
|
||||||
|
foreach (var editor in w.tracker.activeEditors)
|
||||||
|
{
|
||||||
|
var assetImporterEditor = editor as AssetImporterEditor;
|
||||||
|
|
||||||
|
if (assetImporterEditor != null && assetImporterEditor.HasModified())
|
||||||
|
{
|
||||||
|
assetImporterEditor.ApplyAndImport();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
w.Close();
|
||||||
|
}
|
||||||
|
windows.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void CloseWindows()
|
||||||
|
{
|
||||||
|
foreach (var w in windows)
|
||||||
|
{
|
||||||
|
w.Close();
|
||||||
|
}
|
||||||
|
windows.Clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 06fa8aa0de8ea5442b6454c3a8edfdc6
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Loading…
x
Reference in New Issue
Block a user