0.6.6: Fixed issues with both canvas and scene picker

* 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
This commit is contained in:
Anders Ejlersen 2021-09-04 22:54:11 +02:00
parent b07117c9bf
commit 63f2101917
6 changed files with 50 additions and 8 deletions

View file

@ -0,0 +1,26 @@
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();
}
}
}