26 lines
743 B
C#
26 lines
743 B
C#
using Module.NavigationTool.Editor.Tools;
|
|
using UnityEditor;
|
|
using UnityEngine.SceneManagement;
|
|
|
|
namespace Module.NavigationTool.Editor.Toolbar
|
|
{
|
|
[InitializeOnLoad]
|
|
internal static class ToolScenePickerEditorStateChanged
|
|
{
|
|
static ToolScenePickerEditorStateChanged()
|
|
{
|
|
EditorApplication.playModeStateChanged += OnPlayModeStateChanged;
|
|
SceneManager.activeSceneChanged += OnActiveSceneChanged;
|
|
}
|
|
|
|
private static void OnPlayModeStateChanged(PlayModeStateChange state)
|
|
{
|
|
ToolScenePicker.SetAsDirty();
|
|
}
|
|
|
|
private static void OnActiveSceneChanged(Scene current, Scene next)
|
|
{
|
|
ToolScenePicker.SetAsDirty();
|
|
}
|
|
}
|
|
} |