0.6.3: Fixed issue, where toolbar items didn't accept mouse input in 2021 or newer versions
This commit is contained in:
parent
17c55cd03c
commit
99c83ea6d3
9 changed files with 186 additions and 73 deletions
|
|
@ -1,6 +1,5 @@
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Game.NavigationTool.Editor.Toolbar;
|
||||
using JetBrains.Annotations;
|
||||
using UnityEditor;
|
||||
using UnityEditor.SceneManagement;
|
||||
|
|
@ -10,18 +9,17 @@ using UnityEngine.SceneManagement;
|
|||
namespace Game.NavigationTool.Editor.Tools
|
||||
{
|
||||
[UsedImplicitly]
|
||||
internal sealed class ToolScenePicker : IToolbarDrawer
|
||||
internal sealed class ToolScenePicker : AbstractToolbarDrawer
|
||||
{
|
||||
public bool Visible => true;
|
||||
public bool Enabled => !EditorApplication.isPlaying && !EditorApplication.isPlayingOrWillChangePlaymode;
|
||||
public EToolbarPlacement Placement => EToolbarPlacement.Right;
|
||||
public override bool Enabled => !EditorApplication.isPlaying && !EditorApplication.isPlayingOrWillChangePlaymode;
|
||||
public override EToolbarPlacement Placement => EToolbarPlacement.Right;
|
||||
|
||||
private static bool IS_DIRTY = true;
|
||||
private static int SELECTED_INDEX = -1;
|
||||
private static string[] OPTIONS = new string[0];
|
||||
private static string[] PATHS = new string[0];
|
||||
|
||||
private void Initialize()
|
||||
|
||||
private static void Initialize()
|
||||
{
|
||||
if (!IS_DIRTY)
|
||||
return;
|
||||
|
|
@ -67,13 +65,13 @@ namespace Game.NavigationTool.Editor.Tools
|
|||
SELECTED_INDEX = listPaths.IndexOf(activeScene.path);
|
||||
IS_DIRTY = false;
|
||||
}
|
||||
|
||||
public void Update()
|
||||
|
||||
public override void Update()
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
public void Draw(Rect rect, Styles styles)
|
||||
protected override void Draw(Rect rect)
|
||||
{
|
||||
Initialize();
|
||||
int temp = EditorGUI.Popup(rect, SELECTED_INDEX, OPTIONS, styles.popup);
|
||||
|
|
@ -90,7 +88,7 @@ namespace Game.NavigationTool.Editor.Tools
|
|||
}
|
||||
}
|
||||
|
||||
public float CalculateWidth()
|
||||
public override float CalculateWidth()
|
||||
{
|
||||
return 100.0f;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue