* Scene: Fixed issue, where scene picker wouldn't update correctly, when in play mode and changing active scene * Canvas: Fixed issue, where it wasn't possible to select canvas in prefab stage
26 lines
739 B
C#
26 lines
739 B
C#
using Game.NavigationTool.Editor.Tools;
|
|
using UnityEditor;
|
|
using UnityEngine.SceneManagement;
|
|
|
|
namespace Game.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();
|
|
}
|
|
}
|
|
} |