0.5.0: Added toolbar with scene picker

This commit is contained in:
Anders Ejlersen 2021-03-11 12:27:50 +01:00
parent d35a79faf1
commit 27d7ecb2dd
19 changed files with 365 additions and 3 deletions

View file

@ -0,0 +1,20 @@
using System.Linq;
using Game.NavigationTool.Editor.Tools;
using UnityEditor;
namespace Game.NavigationTool.Editor.Toolbar
{
internal sealed class ToolbarPostProcess : AssetPostprocessor
{
private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
{
if (HasChange(deletedAssets) || HasChange(movedAssets) || HasChange(importedAssets))
ToolScenePicker.SetAsDirty();
}
private static bool HasChange(string[] assets)
{
return assets.Any(s => s.EndsWith(".unity"));
}
}
}