* Add expander to Unity struct inspectors, collapsed by default
* `UnityEngine.Color` labels in Reflection Inspector are now the same color as the value for convenience
* Cleaned up InputHelper
This commit is contained in:
sinaioutlander
2020-09-08 23:47:17 +10:00
parent 5086dcc82b
commit 0769b7ef23
8 changed files with 160 additions and 64 deletions

View File

@ -9,6 +9,8 @@ namespace Explorer
{
public class CacheRect : CacheObjectBase
{
private bool IsExpanded;
private string x = "0";
private string y = "0";
private string w = "0";
@ -28,9 +30,27 @@ namespace Explorer
public override void DrawValue(Rect window, float width)
{
if (CanWrite)
{
if (!IsExpanded)
{
if (GUILayout.Button("v", new GUILayoutOption[] { GUILayout.Width(25) }))
{
IsExpanded = true;
}
}
else
{
if (GUILayout.Button("^", new GUILayoutOption[] { GUILayout.Width(25) }))
{
IsExpanded = false;
}
}
}
GUILayout.Label($"<color=yellow>Rect</color>: {((Rect)Value).ToString()}", null);
if (CanWrite)
if (CanWrite && IsExpanded)
{
GUILayout.EndHorizontal();
var whitespace = window.width - width - 90;