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:
parent
b07117c9bf
commit
63f2101917
6 changed files with 50 additions and 8 deletions
47
Editor/Toolbar/Tools/ToolUICanvasPickerEditorStateChanged.cs
Normal file
47
Editor/Toolbar/Tools/ToolUICanvasPickerEditorStateChanged.cs
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
using Game.NavigationTool.Editor.Tools;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Experimental.SceneManagement;
|
||||
using UnityEditor.SceneManagement;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
namespace Game.NavigationTool.Editor.Toolbar
|
||||
{
|
||||
[InitializeOnLoad]
|
||||
internal static class ToolUICanvasPickerPostProcess
|
||||
{
|
||||
static ToolUICanvasPickerPostProcess()
|
||||
{
|
||||
EditorSceneManager.sceneSaved += OnSceneSaved;
|
||||
EditorSceneManager.sceneOpened += OnSceneOpened;
|
||||
EditorSceneManager.sceneClosed += OnSceneClosed;
|
||||
|
||||
PrefabStage.prefabStageOpened += OnPrefabStageOpened;
|
||||
PrefabStage.prefabStageClosing += OnPrefabStageClosing;
|
||||
}
|
||||
|
||||
private static void OnSceneSaved(Scene scene)
|
||||
{
|
||||
ToolUICanvasPicker.SetAsDirty();
|
||||
}
|
||||
|
||||
private static void OnSceneOpened(Scene scene, OpenSceneMode mode)
|
||||
{
|
||||
ToolUICanvasPicker.SetAsDirty();
|
||||
}
|
||||
|
||||
private static void OnSceneClosed(Scene scene)
|
||||
{
|
||||
ToolUICanvasPicker.SetAsDirty();
|
||||
}
|
||||
|
||||
private static void OnPrefabStageOpened(PrefabStage stage)
|
||||
{
|
||||
ToolUICanvasPicker.SetAsDirty();
|
||||
}
|
||||
|
||||
private static void OnPrefabStageClosing(PrefabStage stage)
|
||||
{
|
||||
ToolUICanvasPicker.SetAsDirty();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue