1.8.4: Added PopupFromScriptableObjectType
This commit is contained in:
parent
3259b62387
commit
81906d49dd
12 changed files with 202 additions and 1 deletions
|
|
@ -0,0 +1,30 @@
|
|||
using UnityEditor;
|
||||
|
||||
namespace Module.Inspector.Editor.AssetImporters
|
||||
{
|
||||
internal sealed class EditorAssetImporterForScriptableObject : AssetPostprocessor
|
||||
{
|
||||
public static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
|
||||
{
|
||||
if (HasAnyScriptableObjects(importedAssets) ||
|
||||
HasAnyScriptableObjects(deletedAssets) ||
|
||||
HasAnyScriptableObjects(movedAssets))
|
||||
{
|
||||
EditorUtilitySearchObject.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
private static bool HasAnyScriptableObjects(string[] paths)
|
||||
{
|
||||
for (var i = 0; i < paths.Length; i++)
|
||||
{
|
||||
string path = paths[i];
|
||||
|
||||
if (path.EndsWith(".asset"))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a1d618b9d79641b79e5815e258baeecb
|
||||
timeCreated: 1702156766
|
||||
Loading…
Add table
Add a link
Reference in a new issue