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
39
Editor/Toolbar/AbstractToolbarDrawer.cs
Normal file
39
Editor/Toolbar/AbstractToolbarDrawer.cs
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
using Game.NavigationTool.Editor.Toolbar;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Game.NavigationTool.Editor
|
||||
{
|
||||
public abstract class AbstractToolbarDrawer
|
||||
{
|
||||
public abstract bool Enabled { get; }
|
||||
public abstract EToolbarPlacement Placement { get; }
|
||||
|
||||
private Rect rect;
|
||||
protected Styles styles;
|
||||
|
||||
public void Setup(Rect rect)
|
||||
{
|
||||
this.rect = rect;
|
||||
}
|
||||
|
||||
public virtual void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void OnGUI()
|
||||
{
|
||||
if (styles == null)
|
||||
styles = new Styles();
|
||||
|
||||
styles.Initialize(GUI.skin);
|
||||
|
||||
GUI.enabled = Enabled;
|
||||
Draw(rect);
|
||||
GUI.enabled = true;
|
||||
}
|
||||
|
||||
protected abstract void Draw(Rect rect);
|
||||
public abstract float CalculateWidth();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue