Navigation tools upgraded to use the new MainToolbarElement API
This commit is contained in:
parent
708b99f763
commit
3e1602162c
52 changed files with 837 additions and 66 deletions
|
|
@ -0,0 +1,22 @@
|
|||
#if UNITY_6000_3_OR_NEWER
|
||||
using System.Linq;
|
||||
using UnityEditor;
|
||||
|
||||
namespace Module.NavigationTool.Editor.Toolbar
|
||||
{
|
||||
internal sealed class MainToolbarScenePickerPostProcess : AssetPostprocessor
|
||||
{
|
||||
private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
|
||||
{
|
||||
if (HasChange(deletedAssets) || HasChange(movedAssets) || HasChange(importedAssets))
|
||||
MainToolbarScenePickerElement.Refresh();
|
||||
}
|
||||
|
||||
private static bool HasChange(string[] assets)
|
||||
{
|
||||
return assets.Any(s => s.EndsWith(".unity")) ||
|
||||
assets.Any(s => s.EndsWith("EditorBuildSettings.asset"));
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue