0.1.0: Added favorites window
This commit is contained in:
parent
80499f0a7e
commit
dea60c6e4a
37 changed files with 1129 additions and 0 deletions
47
Editor/Favorites/Window/Styles/Styles.cs
Normal file
47
Editor/Favorites/Window/Styles/Styles.cs
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
using UnityEngine;
|
||||
|
||||
namespace Game.NavigationTool.Editor
|
||||
{
|
||||
internal sealed class Styles
|
||||
{
|
||||
public GUIStyle toolbox;
|
||||
public GUIStyle buttonAddFolder;
|
||||
|
||||
public GUIStyle entry;
|
||||
public Texture2D foldoutIn;
|
||||
public Texture2D foldoutOut;
|
||||
|
||||
public GUIStyle contextOption;
|
||||
|
||||
private GUISkin skin;
|
||||
|
||||
public void Initialize(GUISkin skin)
|
||||
{
|
||||
if (this.skin == skin)
|
||||
return;
|
||||
|
||||
toolbox = new GUIStyle(skin.box);
|
||||
|
||||
buttonAddFolder = new GUIStyle(skin.button);
|
||||
buttonAddFolder.padding = new RectOffset(4, 0, 0, 4);
|
||||
|
||||
entry = new GUIStyle(skin.label);
|
||||
entry.hover.textColor = entry.onHover.textColor = Color.white;
|
||||
entry.active.textColor = entry.onActive.textColor = Color.yellow;
|
||||
|
||||
GUIStyle style = skin.FindStyle("Foldout");
|
||||
|
||||
if (style != null)
|
||||
{
|
||||
foldoutIn = style.normal.scaledBackgrounds[0];
|
||||
foldoutOut = style.onNormal.scaledBackgrounds[0];
|
||||
}
|
||||
|
||||
contextOption = new GUIStyle(skin.label);
|
||||
contextOption.hover.textColor = contextOption.onHover.textColor = Color.white;
|
||||
contextOption.hover.scaledBackgrounds = contextOption.onHover.scaledBackgrounds = skin.box.normal.scaledBackgrounds;
|
||||
contextOption.active.textColor = contextOption.onActive.textColor = Color.yellow;
|
||||
contextOption.active.scaledBackgrounds = contextOption.onActive.scaledBackgrounds = skin.box.normal.scaledBackgrounds;
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Editor/Favorites/Window/Styles/Styles.cs.meta
Normal file
3
Editor/Favorites/Window/Styles/Styles.cs.meta
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6d7dcc40bb3d471d91439071d6157a8f
|
||||
timeCreated: 1613211898
|
||||
Loading…
Add table
Add a link
Reference in a new issue