mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-06-16 22:27:45 +08:00
1.7.2
unstrip fixes
This commit is contained in:
parent
653b4a2304
commit
dc2759c599
@ -379,7 +379,7 @@ namespace Explorer
|
|||||||
|
|
||||||
if (MemInfo != null)
|
if (MemInfo != null)
|
||||||
{
|
{
|
||||||
GUILayout.Label(RichTextName, new GUILayoutOption[] { GUILayout.Width(labelWidth) });
|
GUIUnstrip.Label(RichTextName, new GUILayoutOption[] { GUILayout.Width(labelWidth) });
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -408,15 +408,15 @@ namespace Explorer
|
|||||||
|
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
|
|
||||||
GUILayout.Label(i.ToString(), new GUILayoutOption[] { GUILayout.Width(20) });
|
GUIUnstrip.Label(i.ToString(), new GUILayoutOption[] { GUILayout.Width(20) });
|
||||||
m_argumentInput[i] = GUILayout.TextField(input, new GUILayoutOption[] { GUILayout.Width(150) });
|
m_argumentInput[i] = GUIUnstrip.TextField(input, new GUILayoutOption[] { GUILayout.Width(150) });
|
||||||
GUILayout.Label(label, null);
|
GUIUnstrip.Label(label);
|
||||||
|
|
||||||
GUIUnstrip.EndHorizontal();
|
GUIUnstrip.EndHorizontal();
|
||||||
}
|
}
|
||||||
|
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
if (GUILayout.Button(EVALUATE_LABEL, new GUILayoutOption[] { GUILayout.Width(70) }))
|
if (GUIUnstrip.Button(EVALUATE_LABEL, new GUILayoutOption[] { GUILayout.Width(70) }))
|
||||||
{
|
{
|
||||||
if (cm != null)
|
if (cm != null)
|
||||||
{
|
{
|
||||||
@ -427,7 +427,7 @@ namespace Explorer
|
|||||||
UpdateValue();
|
UpdateValue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (GUILayout.Button("Cancel", new GUILayoutOption[] { GUILayout.Width(70) }))
|
if (GUIUnstrip.Button("Cancel", new GUILayoutOption[] { GUILayout.Width(70) }))
|
||||||
{
|
{
|
||||||
m_isEvaluating = false;
|
m_isEvaluating = false;
|
||||||
}
|
}
|
||||||
@ -435,7 +435,7 @@ namespace Explorer
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (GUILayout.Button($"Evaluate ({m_arguments.Length} params)", new GUILayoutOption[] { GUILayout.Width(150) }))
|
if (GUIUnstrip.Button($"Evaluate ({m_arguments.Length} params)", new GUILayoutOption[] { GUILayout.Width(150) }))
|
||||||
{
|
{
|
||||||
m_isEvaluating = true;
|
m_isEvaluating = true;
|
||||||
}
|
}
|
||||||
@ -452,7 +452,7 @@ namespace Explorer
|
|||||||
{
|
{
|
||||||
//GUIUnstrip.BeginHorizontal();
|
//GUIUnstrip.BeginHorizontal();
|
||||||
|
|
||||||
if (GUILayout.Button(EVALUATE_LABEL, new GUILayoutOption[] { GUILayout.Width(70) }))
|
if (GUIUnstrip.Button(EVALUATE_LABEL, new GUILayoutOption[] { GUILayout.Width(70) }))
|
||||||
{
|
{
|
||||||
cm.Evaluate();
|
cm.Evaluate();
|
||||||
}
|
}
|
||||||
@ -465,15 +465,15 @@ namespace Explorer
|
|||||||
|
|
||||||
if (!string.IsNullOrEmpty(ReflectionException))
|
if (!string.IsNullOrEmpty(ReflectionException))
|
||||||
{
|
{
|
||||||
GUILayout.Label("<color=red>Reflection failed!</color> (" + ReflectionException + ")", null);
|
GUIUnstrip.Label("<color=red>Reflection failed!</color> (" + ReflectionException + ")");
|
||||||
}
|
}
|
||||||
else if ((HasParameters || this is CacheMethod) && !m_evaluated)
|
else if ((HasParameters || this is CacheMethod) && !m_evaluated)
|
||||||
{
|
{
|
||||||
GUILayout.Label($"<color=grey><i>Not yet evaluated</i></color> (<color=#2df7b2>{ValueTypeName}</color>)", null);
|
GUIUnstrip.Label($"<color=grey><i>Not yet evaluated</i></color> (<color=#2df7b2>{ValueTypeName}</color>)");
|
||||||
}
|
}
|
||||||
else if (Value == null && !(this is CacheMethod))
|
else if (Value == null && !(this is CacheMethod))
|
||||||
{
|
{
|
||||||
GUILayout.Label("<i>null (" + ValueTypeName + ")</i>", null);
|
GUIUnstrip.Label("<i>null (" + ValueTypeName + ")</i>");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -202,7 +202,7 @@ namespace Explorer
|
|||||||
{
|
{
|
||||||
if (m_cachedKeys == null || m_cachedValues == null)
|
if (m_cachedKeys == null || m_cachedValues == null)
|
||||||
{
|
{
|
||||||
GUILayout.Label("Cached keys or values is null!", null);
|
GUIUnstrip.Label("Cached keys or values is null!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -212,14 +212,14 @@ namespace Explorer
|
|||||||
|
|
||||||
if (!IsExpanded)
|
if (!IsExpanded)
|
||||||
{
|
{
|
||||||
if (GUILayout.Button("v", new GUILayoutOption[] { GUILayout.Width(25) }))
|
if (GUIUnstrip.Button("v", new GUILayoutOption[] { GUILayout.Width(25) }))
|
||||||
{
|
{
|
||||||
IsExpanded = true;
|
IsExpanded = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (GUILayout.Button("^", new GUILayoutOption[] { GUILayout.Width(25) }))
|
if (GUIUnstrip.Button("^", new GUILayoutOption[] { GUILayout.Width(25) }))
|
||||||
{
|
{
|
||||||
IsExpanded = false;
|
IsExpanded = false;
|
||||||
}
|
}
|
||||||
@ -229,7 +229,7 @@ namespace Explorer
|
|||||||
|
|
||||||
GUI.skin.button.alignment = TextAnchor.MiddleLeft;
|
GUI.skin.button.alignment = TextAnchor.MiddleLeft;
|
||||||
string btnLabel = $"[{count}] <color=#2df7b2>Dictionary<{TypeOfKeys.FullName}, {TypeOfValues.FullName}></color>";
|
string btnLabel = $"[{count}] <color=#2df7b2>Dictionary<{TypeOfKeys.FullName}, {TypeOfValues.FullName}></color>";
|
||||||
if (GUILayout.Button(btnLabel, new GUILayoutOption[] { GUILayout.Width(negativeWhitespace) }))
|
if (GUIUnstrip.Button(btnLabel, new GUILayoutOption[] { GUILayout.Width(negativeWhitespace) }))
|
||||||
{
|
{
|
||||||
WindowManager.InspectObject(Value, out bool _);
|
WindowManager.InspectObject(Value, out bool _);
|
||||||
}
|
}
|
||||||
@ -251,11 +251,11 @@ namespace Explorer
|
|||||||
Pages.CurrentPageLabel();
|
Pages.CurrentPageLabel();
|
||||||
|
|
||||||
// prev/next page buttons
|
// prev/next page buttons
|
||||||
if (GUILayout.Button("< Prev", new GUILayoutOption[] { GUILayout.Width(60) }))
|
if (GUIUnstrip.Button("< Prev", new GUILayoutOption[] { GUILayout.Width(60) }))
|
||||||
{
|
{
|
||||||
Pages.TurnPage(Turn.Left);
|
Pages.TurnPage(Turn.Left);
|
||||||
}
|
}
|
||||||
if (GUILayout.Button("Next >", new GUILayoutOption[] { GUILayout.Width(60) }))
|
if (GUIUnstrip.Button("Next >", new GUILayoutOption[] { GUILayout.Width(60) }))
|
||||||
{
|
{
|
||||||
Pages.TurnPage(Turn.Right);
|
Pages.TurnPage(Turn.Right);
|
||||||
}
|
}
|
||||||
@ -280,17 +280,17 @@ namespace Explorer
|
|||||||
|
|
||||||
if (key == null || val == null)
|
if (key == null || val == null)
|
||||||
{
|
{
|
||||||
GUILayout.Label($"[{i}] <i><color=grey>(null)</color></i>", null);
|
GUIUnstrip.Label($"[{i}] <i><color=grey>(null)</color></i>");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GUI.skin.label.alignment = TextAnchor.MiddleCenter;
|
GUI.skin.label.alignment = TextAnchor.MiddleCenter;
|
||||||
GUILayout.Label($"[{i}]", new GUILayoutOption[] { GUILayout.Width(30) });
|
GUIUnstrip.Label($"[{i}]", new GUILayoutOption[] { GUILayout.Width(30) });
|
||||||
|
|
||||||
GUILayout.Label("Key:", new GUILayoutOption[] { GUILayout.Width(40) });
|
GUIUnstrip.Label("Key:", new GUILayoutOption[] { GUILayout.Width(40) });
|
||||||
key.DrawValue(window, (window.width / 2) - 30f);
|
key.DrawValue(window, (window.width / 2) - 30f);
|
||||||
|
|
||||||
GUILayout.Label("Value:", new GUILayoutOption[] { GUILayout.Width(40) });
|
GUIUnstrip.Label("Value:", new GUILayoutOption[] { GUILayout.Width(40) });
|
||||||
val.DrawValue(window, (window.width / 2) - 30f);
|
val.DrawValue(window, (window.width / 2) - 30f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -264,7 +264,7 @@ namespace Explorer
|
|||||||
{
|
{
|
||||||
if (m_cachedEntries == null)
|
if (m_cachedEntries == null)
|
||||||
{
|
{
|
||||||
GUILayout.Label("m_cachedEntries is null!", null);
|
GUIUnstrip.Label("m_cachedEntries is null!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -274,14 +274,14 @@ namespace Explorer
|
|||||||
|
|
||||||
if (!IsExpanded)
|
if (!IsExpanded)
|
||||||
{
|
{
|
||||||
if (GUILayout.Button("v", new GUILayoutOption[] { GUILayout.Width(25) }))
|
if (GUIUnstrip.Button("v", new GUILayoutOption[] { GUILayout.Width(25) }))
|
||||||
{
|
{
|
||||||
IsExpanded = true;
|
IsExpanded = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (GUILayout.Button("^", new GUILayoutOption[] { GUILayout.Width(25) }))
|
if (GUIUnstrip.Button("^", new GUILayoutOption[] { GUILayout.Width(25) }))
|
||||||
{
|
{
|
||||||
IsExpanded = false;
|
IsExpanded = false;
|
||||||
}
|
}
|
||||||
@ -291,7 +291,7 @@ namespace Explorer
|
|||||||
|
|
||||||
GUI.skin.button.alignment = TextAnchor.MiddleLeft;
|
GUI.skin.button.alignment = TextAnchor.MiddleLeft;
|
||||||
string btnLabel = $"[{count}] <color=#2df7b2>{EntryType.FullName}</color>";
|
string btnLabel = $"[{count}] <color=#2df7b2>{EntryType.FullName}</color>";
|
||||||
if (GUILayout.Button(btnLabel, new GUILayoutOption[] { GUILayout.MaxWidth(negativeWhitespace) }))
|
if (GUIUnstrip.Button(btnLabel, new GUILayoutOption[] { GUILayout.MaxWidth(negativeWhitespace) }))
|
||||||
{
|
{
|
||||||
WindowManager.InspectObject(Value, out bool _);
|
WindowManager.InspectObject(Value, out bool _);
|
||||||
}
|
}
|
||||||
@ -313,11 +313,11 @@ namespace Explorer
|
|||||||
Pages.CurrentPageLabel();
|
Pages.CurrentPageLabel();
|
||||||
|
|
||||||
// prev/next page buttons
|
// prev/next page buttons
|
||||||
if (GUILayout.Button("< Prev", new GUILayoutOption[] { GUILayout.Width(60) }))
|
if (GUIUnstrip.Button("< Prev", new GUILayoutOption[] { GUILayout.Width(60) }))
|
||||||
{
|
{
|
||||||
Pages.TurnPage(Turn.Left);
|
Pages.TurnPage(Turn.Left);
|
||||||
}
|
}
|
||||||
if (GUILayout.Button("Next >", new GUILayoutOption[] { GUILayout.Width(60) }))
|
if (GUIUnstrip.Button("Next >", new GUILayoutOption[] { GUILayout.Width(60) }))
|
||||||
{
|
{
|
||||||
Pages.TurnPage(Turn.Right);
|
Pages.TurnPage(Turn.Right);
|
||||||
}
|
}
|
||||||
@ -341,12 +341,12 @@ namespace Explorer
|
|||||||
|
|
||||||
if (entry == null || entry.Value == null)
|
if (entry == null || entry.Value == null)
|
||||||
{
|
{
|
||||||
GUILayout.Label($"[{i}] <i><color=grey>(null)</color></i>", null);
|
GUIUnstrip.Label($"[{i}] <i><color=grey>(null)</color></i>");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GUI.skin.label.alignment = TextAnchor.MiddleCenter;
|
GUI.skin.label.alignment = TextAnchor.MiddleCenter;
|
||||||
GUILayout.Label($"[{i}]", new GUILayoutOption[] { GUILayout.Width(30) });
|
GUIUnstrip.Label($"[{i}]", new GUILayoutOption[] { GUILayout.Width(30) });
|
||||||
|
|
||||||
entry.DrawValue(window, window.width - (whitespace + 85));
|
entry.DrawValue(window, window.width - (whitespace + 85));
|
||||||
}
|
}
|
||||||
|
@ -78,12 +78,12 @@ namespace Explorer
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GUILayout.Label($"null (<color=#2df7b2>{ValueTypeName}</color>)", null);
|
GUIUnstrip.Label($"null (<color=#2df7b2>{ValueTypeName}</color>)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GUILayout.Label($"<color=grey><i>Not yet evaluated</i></color> (<color=#2df7b2>{ValueTypeName}</color>)", null);
|
GUIUnstrip.Label($"<color=grey><i>Not yet evaluated</i></color> (<color=#2df7b2>{ValueTypeName}</color>)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ namespace Explorer
|
|||||||
}
|
}
|
||||||
|
|
||||||
GUI.skin.button.alignment = TextAnchor.MiddleLeft;
|
GUI.skin.button.alignment = TextAnchor.MiddleLeft;
|
||||||
if (GUILayout.Button(label, new GUILayoutOption[] { GUILayout.Width(width - 15) }))
|
if (GUIUnstrip.Button(label, new GUILayoutOption[] { GUILayout.Width(width - 15) }))
|
||||||
{
|
{
|
||||||
WindowManager.InspectObject(Value, out bool _);
|
WindowManager.InspectObject(Value, out bool _);
|
||||||
}
|
}
|
||||||
|
@ -35,14 +35,14 @@ namespace Explorer
|
|||||||
{
|
{
|
||||||
if (!IsExpanded)
|
if (!IsExpanded)
|
||||||
{
|
{
|
||||||
if (GUILayout.Button("v", new GUILayoutOption[] { GUILayout.Width(25) }))
|
if (GUIUnstrip.Button("v", new GUILayoutOption[] { GUILayout.Width(25) }))
|
||||||
{
|
{
|
||||||
IsExpanded = true;
|
IsExpanded = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (GUILayout.Button("^", new GUILayoutOption[] { GUILayout.Width(25) }))
|
if (GUIUnstrip.Button("^", new GUILayoutOption[] { GUILayout.Width(25) }))
|
||||||
{
|
{
|
||||||
IsExpanded = false;
|
IsExpanded = false;
|
||||||
}
|
}
|
||||||
@ -51,7 +51,7 @@ namespace Explorer
|
|||||||
|
|
||||||
//var c = (Color)Value;
|
//var c = (Color)Value;
|
||||||
//GUI.color = c;
|
//GUI.color = c;
|
||||||
GUILayout.Label($"<color=#2df7b2>Color:</color> {((Color)Value).ToString()}", null);
|
GUIUnstrip.Label($"<color=#2df7b2>Color:</color> {((Color)Value).ToString()}");
|
||||||
//GUI.color = Color.white;
|
//GUI.color = Color.white;
|
||||||
|
|
||||||
if (CanWrite && IsExpanded)
|
if (CanWrite && IsExpanded)
|
||||||
@ -62,32 +62,32 @@ namespace Explorer
|
|||||||
|
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
GUIUnstrip.Space(whitespace);
|
GUIUnstrip.Space(whitespace);
|
||||||
GUILayout.Label("R:", new GUILayoutOption[] { GUILayout.Width(30) });
|
GUIUnstrip.Label("R:", new GUILayoutOption[] { GUILayout.Width(30) });
|
||||||
r = GUILayout.TextField(r, new GUILayoutOption[] { GUILayout.Width(120) });
|
r = GUIUnstrip.TextField(r, new GUILayoutOption[] { GUILayout.Width(120) });
|
||||||
GUIUnstrip.EndHorizontal();
|
GUIUnstrip.EndHorizontal();
|
||||||
|
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
GUIUnstrip.Space(whitespace);
|
GUIUnstrip.Space(whitespace);
|
||||||
GUILayout.Label("G:", new GUILayoutOption[] { GUILayout.Width(30) });
|
GUIUnstrip.Label("G:", new GUILayoutOption[] { GUILayout.Width(30) });
|
||||||
g = GUILayout.TextField(g, new GUILayoutOption[] { GUILayout.Width(120) });
|
g = GUIUnstrip.TextField(g, new GUILayoutOption[] { GUILayout.Width(120) });
|
||||||
GUIUnstrip.EndHorizontal();
|
GUIUnstrip.EndHorizontal();
|
||||||
|
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
GUIUnstrip.Space(whitespace);
|
GUIUnstrip.Space(whitespace);
|
||||||
GUILayout.Label("B:", new GUILayoutOption[] { GUILayout.Width(30) });
|
GUIUnstrip.Label("B:", new GUILayoutOption[] { GUILayout.Width(30) });
|
||||||
b = GUILayout.TextField(b, new GUILayoutOption[] { GUILayout.Width(120) });
|
b = GUIUnstrip.TextField(b, new GUILayoutOption[] { GUILayout.Width(120) });
|
||||||
GUIUnstrip.EndHorizontal();
|
GUIUnstrip.EndHorizontal();
|
||||||
|
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
GUIUnstrip.Space(whitespace);
|
GUIUnstrip.Space(whitespace);
|
||||||
GUILayout.Label("A:", new GUILayoutOption[] { GUILayout.Width(30) });
|
GUIUnstrip.Label("A:", new GUILayoutOption[] { GUILayout.Width(30) });
|
||||||
a = GUILayout.TextField(a, new GUILayoutOption[] { GUILayout.Width(120) });
|
a = GUIUnstrip.TextField(a, new GUILayoutOption[] { GUILayout.Width(120) });
|
||||||
GUIUnstrip.EndHorizontal();
|
GUIUnstrip.EndHorizontal();
|
||||||
|
|
||||||
// draw set value button
|
// draw set value button
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
GUIUnstrip.Space(whitespace);
|
GUIUnstrip.Space(whitespace);
|
||||||
if (GUILayout.Button("<color=lime>Apply</color>", new GUILayoutOption[] { GUILayout.Width(155) }))
|
if (GUIUnstrip.Button("<color=lime>Apply</color>", new GUILayoutOption[] { GUILayout.Width(155) }))
|
||||||
{
|
{
|
||||||
SetValueFromInput();
|
SetValueFromInput();
|
||||||
}
|
}
|
||||||
|
@ -39,19 +39,19 @@ namespace Explorer
|
|||||||
{
|
{
|
||||||
if (CanWrite)
|
if (CanWrite)
|
||||||
{
|
{
|
||||||
if (GUILayout.Button("<", new GUILayoutOption[] { GUILayout.Width(25) }))
|
if (GUIUnstrip.Button("<", new GUILayoutOption[] { GUILayout.Width(25) }))
|
||||||
{
|
{
|
||||||
SetEnum(ref Value, -1);
|
SetEnum(ref Value, -1);
|
||||||
SetValue();
|
SetValue();
|
||||||
}
|
}
|
||||||
if (GUILayout.Button(">", new GUILayoutOption[] { GUILayout.Width(25) }))
|
if (GUIUnstrip.Button(">", new GUILayoutOption[] { GUILayout.Width(25) }))
|
||||||
{
|
{
|
||||||
SetEnum(ref Value, 1);
|
SetEnum(ref Value, 1);
|
||||||
SetValue();
|
SetValue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GUILayout.Label(Value.ToString() + "<color=#2df7b2><i> (" + ValueType + ")</i></color>", null);
|
GUIUnstrip.Label(Value.ToString() + "<color=#2df7b2><i> (" + ValueType + ")</i></color>");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetEnum(ref object value, int change)
|
public void SetEnum(ref object value, int change)
|
||||||
|
@ -55,7 +55,7 @@ namespace Explorer
|
|||||||
|
|
||||||
if (CanWrite)
|
if (CanWrite)
|
||||||
{
|
{
|
||||||
b = GUILayout.Toggle(b, label, null);
|
b = GUIUnstrip.Toggle(b, label);
|
||||||
if (b != (bool)Value)
|
if (b != (bool)Value)
|
||||||
{
|
{
|
||||||
SetValueFromInput(b.ToString());
|
SetValueFromInput(b.ToString());
|
||||||
@ -63,13 +63,13 @@ namespace Explorer
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GUILayout.Label(label, null);
|
GUIUnstrip.Label(label);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// using ValueType.Name instead of ValueTypeName, because we only want the short name.
|
// using ValueType.Name instead of ValueTypeName, because we only want the short name.
|
||||||
GUILayout.Label("<color=#2df7b2><i>" + ValueType.Name + "</i></color>", new GUILayoutOption[] { GUILayout.Width(50) });
|
GUIUnstrip.Label("<color=#2df7b2><i>" + ValueType.Name + "</i></color>", new GUILayoutOption[] { GUILayout.Width(50) });
|
||||||
|
|
||||||
int dynSize = 25 + (m_valueToString.Length * 15);
|
int dynSize = 25 + (m_valueToString.Length * 15);
|
||||||
var maxwidth = window.width - 310f;
|
var maxwidth = window.width - 310f;
|
||||||
@ -77,16 +77,16 @@ namespace Explorer
|
|||||||
|
|
||||||
if (dynSize > maxwidth)
|
if (dynSize > maxwidth)
|
||||||
{
|
{
|
||||||
m_valueToString = GUILayout.TextArea(m_valueToString, new GUILayoutOption[] { GUILayout.MaxWidth(maxwidth) });
|
m_valueToString = GUIUnstrip.TextArea(m_valueToString, new GUILayoutOption[] { GUILayout.MaxWidth(maxwidth) });
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_valueToString = GUILayout.TextField(m_valueToString, new GUILayoutOption[] { GUILayout.MaxWidth(dynSize) });
|
m_valueToString = GUIUnstrip.TextField(m_valueToString, new GUILayoutOption[] { GUILayout.MaxWidth(dynSize) });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CanWrite)
|
if (CanWrite)
|
||||||
{
|
{
|
||||||
if (GUILayout.Button("<color=#00FF00>Apply</color>", new GUILayoutOption[] { GUILayout.Width(60) }))
|
if (GUIUnstrip.Button("<color=#00FF00>Apply</color>", new GUILayoutOption[] { GUILayout.Width(60) }))
|
||||||
{
|
{
|
||||||
SetValueFromInput(m_valueToString);
|
SetValueFromInput(m_valueToString);
|
||||||
}
|
}
|
||||||
|
@ -33,21 +33,22 @@ namespace Explorer
|
|||||||
{
|
{
|
||||||
if (!IsExpanded)
|
if (!IsExpanded)
|
||||||
{
|
{
|
||||||
if (GUILayout.Button("v", new GUILayoutOption[] { GUILayout.Width(25) }))
|
if (GUIUnstrip.Button("v", new GUILayoutOption[] { GUILayout.Width(25) }))
|
||||||
{
|
{
|
||||||
IsExpanded = true;
|
IsExpanded = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (GUILayout.Button("^", new GUILayoutOption[] { GUILayout.Width(25) }))
|
if (GUIUnstrip.Button("^", new GUILayoutOption[] { GUILayout.Width(25) }))
|
||||||
{
|
{
|
||||||
IsExpanded = false;
|
IsExpanded = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GUILayout.Label($"<color=#2df7b2>Quaternion</color>: {((Quaternion)Value).eulerAngles.ToString()}", null);
|
string lbl = $"<color=#2df7b2>Quaternion</color>: {((Quaternion)Value).eulerAngles.ToString()}";
|
||||||
|
GUIUnstrip.Label(lbl);
|
||||||
|
|
||||||
if (CanWrite && IsExpanded)
|
if (CanWrite && IsExpanded)
|
||||||
{
|
{
|
||||||
@ -57,26 +58,26 @@ namespace Explorer
|
|||||||
|
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
GUIUnstrip.Space(whitespace);
|
GUIUnstrip.Space(whitespace);
|
||||||
GUILayout.Label("X:", new GUILayoutOption[] { GUILayout.Width(30) });
|
GUIUnstrip.Label("X:", new GUILayoutOption[] { GUILayout.Width(30) });
|
||||||
x = GUILayout.TextField(x, new GUILayoutOption[] { GUILayout.Width(120) });
|
x = GUIUnstrip.TextField(x, new GUILayoutOption[] { GUILayout.Width(120) });
|
||||||
GUIUnstrip.EndHorizontal();
|
GUIUnstrip.EndHorizontal();
|
||||||
|
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
GUIUnstrip.Space(whitespace);
|
GUIUnstrip.Space(whitespace);
|
||||||
GUILayout.Label("Y:", new GUILayoutOption[] { GUILayout.Width(30) });
|
GUIUnstrip.Label("Y:", new GUILayoutOption[] { GUILayout.Width(30) });
|
||||||
y = GUILayout.TextField(y, new GUILayoutOption[] { GUILayout.Width(120) });
|
y = GUIUnstrip.TextField(y, new GUILayoutOption[] { GUILayout.Width(120) });
|
||||||
GUIUnstrip.EndHorizontal();
|
GUIUnstrip.EndHorizontal();
|
||||||
|
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
GUIUnstrip.Space(whitespace);
|
GUIUnstrip.Space(whitespace);
|
||||||
GUILayout.Label("Z:", new GUILayoutOption[] { GUILayout.Width(30) });
|
GUIUnstrip.Label("Z:", new GUILayoutOption[] { GUILayout.Width(30) });
|
||||||
z = GUILayout.TextField(z, new GUILayoutOption[] { GUILayout.Width(120) });
|
z = GUIUnstrip.TextField(z, new GUILayoutOption[] { GUILayout.Width(120) });
|
||||||
GUIUnstrip.EndHorizontal();
|
GUIUnstrip.EndHorizontal();
|
||||||
|
|
||||||
// draw set value button
|
// draw set value button
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
GUIUnstrip.Space(whitespace);
|
GUIUnstrip.Space(whitespace);
|
||||||
if (GUILayout.Button("<color=lime>Apply</color>", new GUILayoutOption[] { GUILayout.Width(155) }))
|
if (GUIUnstrip.Button("<color=lime>Apply</color>", new GUILayoutOption[] { GUILayout.Width(155) }))
|
||||||
{
|
{
|
||||||
SetValueFromInput();
|
SetValueFromInput();
|
||||||
}
|
}
|
||||||
|
@ -35,21 +35,21 @@ namespace Explorer
|
|||||||
{
|
{
|
||||||
if (!IsExpanded)
|
if (!IsExpanded)
|
||||||
{
|
{
|
||||||
if (GUILayout.Button("v", new GUILayoutOption[] { GUILayout.Width(25) }))
|
if (GUIUnstrip.Button("v", new GUILayoutOption[] { GUILayout.Width(25) }))
|
||||||
{
|
{
|
||||||
IsExpanded = true;
|
IsExpanded = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (GUILayout.Button("^", new GUILayoutOption[] { GUILayout.Width(25) }))
|
if (GUIUnstrip.Button("^", new GUILayoutOption[] { GUILayout.Width(25) }))
|
||||||
{
|
{
|
||||||
IsExpanded = false;
|
IsExpanded = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GUILayout.Label($"<color=#2df7b2>Rect</color>: {((Rect)Value).ToString()}", null);
|
GUIUnstrip.Label($"<color=#2df7b2>Rect</color>: {((Rect)Value).ToString()}");
|
||||||
|
|
||||||
if (CanWrite && IsExpanded)
|
if (CanWrite && IsExpanded)
|
||||||
{
|
{
|
||||||
@ -59,32 +59,32 @@ namespace Explorer
|
|||||||
|
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
GUIUnstrip.Space(whitespace);
|
GUIUnstrip.Space(whitespace);
|
||||||
GUILayout.Label("X:", new GUILayoutOption[] { GUILayout.Width(30) });
|
GUIUnstrip.Label("X:", new GUILayoutOption[] { GUILayout.Width(30) });
|
||||||
x = GUILayout.TextField(x, new GUILayoutOption[] { GUILayout.Width(120) });
|
x = GUIUnstrip.TextField(x, new GUILayoutOption[] { GUILayout.Width(120) });
|
||||||
GUIUnstrip.EndHorizontal();
|
GUIUnstrip.EndHorizontal();
|
||||||
|
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
GUIUnstrip.Space(whitespace);
|
GUIUnstrip.Space(whitespace);
|
||||||
GUILayout.Label("Y:", new GUILayoutOption[] { GUILayout.Width(30) });
|
GUIUnstrip.Label("Y:", new GUILayoutOption[] { GUILayout.Width(30) });
|
||||||
y = GUILayout.TextField(y, new GUILayoutOption[] { GUILayout.Width(120) });
|
y = GUIUnstrip.TextField(y, new GUILayoutOption[] { GUILayout.Width(120) });
|
||||||
GUIUnstrip.EndHorizontal();
|
GUIUnstrip.EndHorizontal();
|
||||||
|
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
GUIUnstrip.Space(whitespace);
|
GUIUnstrip.Space(whitespace);
|
||||||
GUILayout.Label("W:", new GUILayoutOption[] { GUILayout.Width(30) });
|
GUIUnstrip.Label("W:", new GUILayoutOption[] { GUILayout.Width(30) });
|
||||||
w = GUILayout.TextField(w, new GUILayoutOption[] { GUILayout.Width(120) });
|
w = GUIUnstrip.TextField(w, new GUILayoutOption[] { GUILayout.Width(120) });
|
||||||
GUIUnstrip.EndHorizontal();
|
GUIUnstrip.EndHorizontal();
|
||||||
|
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
GUIUnstrip.Space(whitespace);
|
GUIUnstrip.Space(whitespace);
|
||||||
GUILayout.Label("H:", new GUILayoutOption[] { GUILayout.Width(30) });
|
GUIUnstrip.Label("H:", new GUILayoutOption[] { GUILayout.Width(30) });
|
||||||
h = GUILayout.TextField(h, new GUILayoutOption[] { GUILayout.Width(120) });
|
h = GUIUnstrip.TextField(h, new GUILayoutOption[] { GUILayout.Width(120) });
|
||||||
GUIUnstrip.EndHorizontal();
|
GUIUnstrip.EndHorizontal();
|
||||||
|
|
||||||
// draw set value button
|
// draw set value button
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
GUIUnstrip.Space(whitespace);
|
GUIUnstrip.Space(whitespace);
|
||||||
if (GUILayout.Button("<color=lime>Apply</color>", new GUILayoutOption[] { GUILayout.Width(155) }))
|
if (GUIUnstrip.Button("<color=lime>Apply</color>", new GUILayoutOption[] { GUILayout.Width(155) }))
|
||||||
{
|
{
|
||||||
SetValueFromInput();
|
SetValueFromInput();
|
||||||
}
|
}
|
||||||
|
@ -70,21 +70,21 @@ namespace Explorer
|
|||||||
{
|
{
|
||||||
if (!IsExpanded)
|
if (!IsExpanded)
|
||||||
{
|
{
|
||||||
if (GUILayout.Button("v", new GUILayoutOption[] { GUILayout.Width(25) }))
|
if (GUIUnstrip.Button("v", new GUILayoutOption[] { GUILayout.Width(25) }))
|
||||||
{
|
{
|
||||||
IsExpanded = true;
|
IsExpanded = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (GUILayout.Button("^", new GUILayoutOption[] { GUILayout.Width(25) }))
|
if (GUIUnstrip.Button("^", new GUILayoutOption[] { GUILayout.Width(25) }))
|
||||||
{
|
{
|
||||||
IsExpanded = false;
|
IsExpanded = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GUILayout.Label($"<color=#2df7b2>Vector{VectorSize}</color>: {(string)m_toStringMethod.Invoke(Value, new object[0])}", null);
|
GUIUnstrip.Label($"<color=#2df7b2>Vector{VectorSize}</color>: {(string)m_toStringMethod.Invoke(Value, new object[0])}");
|
||||||
|
|
||||||
if (CanWrite && IsExpanded)
|
if (CanWrite && IsExpanded)
|
||||||
{
|
{
|
||||||
@ -95,14 +95,14 @@ namespace Explorer
|
|||||||
// always draw x and y
|
// always draw x and y
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
GUIUnstrip.Space(whitespace);
|
GUIUnstrip.Space(whitespace);
|
||||||
GUILayout.Label("X:", new GUILayoutOption[] { GUILayout.Width(30) });
|
GUIUnstrip.Label("X:", new GUILayoutOption[] { GUILayout.Width(30) });
|
||||||
x = GUILayout.TextField(x, new GUILayoutOption[] { GUILayout.Width(120) });
|
x = GUIUnstrip.TextField(x, new GUILayoutOption[] { GUILayout.Width(120) });
|
||||||
GUIUnstrip.EndHorizontal();
|
GUIUnstrip.EndHorizontal();
|
||||||
|
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
GUIUnstrip.Space(whitespace);
|
GUIUnstrip.Space(whitespace);
|
||||||
GUILayout.Label("Y:", new GUILayoutOption[] { GUILayout.Width(30) });
|
GUIUnstrip.Label("Y:", new GUILayoutOption[] { GUILayout.Width(30) });
|
||||||
y = GUILayout.TextField(y, new GUILayoutOption[] { GUILayout.Width(120) });
|
y = GUIUnstrip.TextField(y, new GUILayoutOption[] { GUILayout.Width(120) });
|
||||||
GUIUnstrip.EndHorizontal();
|
GUIUnstrip.EndHorizontal();
|
||||||
|
|
||||||
if (VectorSize > 2)
|
if (VectorSize > 2)
|
||||||
@ -110,8 +110,8 @@ namespace Explorer
|
|||||||
// draw z
|
// draw z
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
GUIUnstrip.Space(whitespace);
|
GUIUnstrip.Space(whitespace);
|
||||||
GUILayout.Label("Z:", new GUILayoutOption[] { GUILayout.Width(30) });
|
GUIUnstrip.Label("Z:", new GUILayoutOption[] { GUILayout.Width(30) });
|
||||||
z = GUILayout.TextField(z, new GUILayoutOption[] { GUILayout.Width(120) });
|
z = GUIUnstrip.TextField(z, new GUILayoutOption[] { GUILayout.Width(120) });
|
||||||
GUIUnstrip.EndHorizontal();
|
GUIUnstrip.EndHorizontal();
|
||||||
}
|
}
|
||||||
if (VectorSize > 3)
|
if (VectorSize > 3)
|
||||||
@ -119,15 +119,15 @@ namespace Explorer
|
|||||||
// draw w
|
// draw w
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
GUIUnstrip.Space(whitespace);
|
GUIUnstrip.Space(whitespace);
|
||||||
GUILayout.Label("W:", new GUILayoutOption[] { GUILayout.Width(30) });
|
GUIUnstrip.Label("W:", new GUILayoutOption[] { GUILayout.Width(30) });
|
||||||
w = GUILayout.TextField(w, new GUILayoutOption[] { GUILayout.Width(120) });
|
w = GUIUnstrip.TextField(w, new GUILayoutOption[] { GUILayout.Width(120) });
|
||||||
GUIUnstrip.EndHorizontal();
|
GUIUnstrip.EndHorizontal();
|
||||||
}
|
}
|
||||||
|
|
||||||
// draw set value button
|
// draw set value button
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
GUIUnstrip.Space(whitespace);
|
GUIUnstrip.Space(whitespace);
|
||||||
if (GUILayout.Button("<color=lime>Apply</color>", new GUILayoutOption[] { GUILayout.Width(155) }))
|
if (GUIUnstrip.Button("<color=lime>Apply</color>", new GUILayoutOption[] { GUILayout.Width(155) }))
|
||||||
{
|
{
|
||||||
SetValueFromInput();
|
SetValueFromInput();
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ namespace Explorer
|
|||||||
public class CppExplorer : MelonMod
|
public class CppExplorer : MelonMod
|
||||||
{
|
{
|
||||||
public const string NAME = "CppExplorer";
|
public const string NAME = "CppExplorer";
|
||||||
public const string VERSION = "1.7.1";
|
public const string VERSION = "1.7.2";
|
||||||
public const string AUTHOR = "Sinai";
|
public const string AUTHOR = "Sinai";
|
||||||
public const string GUID = "com.sinai.cppexplorer";
|
public const string GUID = "com.sinai.cppexplorer";
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@
|
|||||||
<Compile Include="Extensions\UnityExtensions.cs" />
|
<Compile Include="Extensions\UnityExtensions.cs" />
|
||||||
<Compile Include="Helpers\PageHelper.cs" />
|
<Compile Include="Helpers\PageHelper.cs" />
|
||||||
<Compile Include="Helpers\ReflectionHelpers.cs" />
|
<Compile Include="Helpers\ReflectionHelpers.cs" />
|
||||||
<Compile Include="Helpers\UIHelpers.cs" />
|
<Compile Include="Menu\UIHelpers.cs" />
|
||||||
<Compile Include="Helpers\UnityHelpers.cs" />
|
<Compile Include="Helpers\UnityHelpers.cs" />
|
||||||
<Compile Include="Menu\InspectUnderMouse.cs" />
|
<Compile Include="Menu\InspectUnderMouse.cs" />
|
||||||
<Compile Include="CachedObjects\CacheObjectBase.cs" />
|
<Compile Include="CachedObjects\CacheObjectBase.cs" />
|
||||||
|
@ -51,7 +51,7 @@ namespace Explorer
|
|||||||
var orig = GUI.skin.label.alignment;
|
var orig = GUI.skin.label.alignment;
|
||||||
GUI.skin.label.alignment = TextAnchor.MiddleCenter;
|
GUI.skin.label.alignment = TextAnchor.MiddleCenter;
|
||||||
|
|
||||||
GUILayout.Label($"Page {PageOffset + 1}/{MaxPageOffset + 1}", new GUILayoutOption[] { GUILayout.Width(80) });
|
GUIUnstrip.Label($"Page {PageOffset + 1}/{MaxPageOffset + 1}", new GUILayoutOption[] { GUILayout.Width(80) });
|
||||||
|
|
||||||
GUI.skin.label.alignment = orig;
|
GUI.skin.label.alignment = orig;
|
||||||
}
|
}
|
||||||
@ -97,9 +97,9 @@ namespace Explorer
|
|||||||
|
|
||||||
public void DrawLimitInputArea()
|
public void DrawLimitInputArea()
|
||||||
{
|
{
|
||||||
GUILayout.Label("Limit: ", new GUILayoutOption[] { GUILayout.Width(50) });
|
GUIUnstrip.Label("Limit: ", new GUILayoutOption[] { GUILayout.Width(50) });
|
||||||
var limit = this.ItemsPerPage.ToString();
|
var limit = this.ItemsPerPage.ToString();
|
||||||
limit = GUILayout.TextField(limit, new GUILayoutOption[] { GUILayout.Width(50) });
|
limit = GUIUnstrip.TextField(limit, new GUILayoutOption[] { GUILayout.Width(50) });
|
||||||
if (limit != ItemsPerPage.ToString() && int.TryParse(limit, out int i))
|
if (limit != ItemsPerPage.ToString() && int.TryParse(limit, out int i))
|
||||||
{
|
{
|
||||||
ItemsPerPage = i;
|
ItemsPerPage = i;
|
||||||
|
@ -91,7 +91,7 @@ namespace Explorer
|
|||||||
else
|
else
|
||||||
GUI.color = Color.white;
|
GUI.color = Color.white;
|
||||||
|
|
||||||
if (GUILayout.Button(Pages[i].Name, null))
|
if (GUIUnstrip.Button(Pages[i].Name))
|
||||||
{
|
{
|
||||||
m_currentPage = i;
|
m_currentPage = i;
|
||||||
}
|
}
|
||||||
@ -100,13 +100,13 @@ namespace Explorer
|
|||||||
|
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
GUI.color = Color.white;
|
GUI.color = Color.white;
|
||||||
InspectUnderMouse.EnableInspect = GUILayout.Toggle(InspectUnderMouse.EnableInspect, "Inspect Under Mouse (Shift + RMB)", null);
|
InspectUnderMouse.EnableInspect = GUIUnstrip.Toggle(InspectUnderMouse.EnableInspect, "Inspect Under Mouse (Shift + RMB)");
|
||||||
|
|
||||||
bool mouseState = CursorControl.ForceUnlockMouse;
|
bool mouseState = CursorControl.ForceUnlockMouse;
|
||||||
bool setMouse = GUILayout.Toggle(mouseState, "Force Unlock Mouse (Left Alt)", null);
|
bool setMouse = GUIUnstrip.Toggle(mouseState, "Force Unlock Mouse (Left Alt)");
|
||||||
if (setMouse != mouseState) CursorControl.ForceUnlockMouse = setMouse;
|
if (setMouse != mouseState) CursorControl.ForceUnlockMouse = setMouse;
|
||||||
|
|
||||||
WindowManager.TabView = GUILayout.Toggle(WindowManager.TabView, "Tab View", null);
|
WindowManager.TabView = GUIUnstrip.Toggle(WindowManager.TabView, "Tab View");
|
||||||
GUIUnstrip.EndHorizontal();
|
GUIUnstrip.EndHorizontal();
|
||||||
|
|
||||||
//GUIUnstrip.Space(10);
|
//GUIUnstrip.Space(10);
|
||||||
|
@ -123,19 +123,19 @@ MelonLogger.Log(""hello world"");";
|
|||||||
|
|
||||||
public override void DrawWindow()
|
public override void DrawWindow()
|
||||||
{
|
{
|
||||||
GUILayout.Label("<b><size=15><color=cyan>C# REPL Console</color></size></b>", null);
|
GUIUnstrip.Label("<b><size=15><color=cyan>C# REPL Console</color></size></b>");
|
||||||
|
|
||||||
GUI.skin.label.alignment = TextAnchor.UpperLeft;
|
GUI.skin.label.alignment = TextAnchor.UpperLeft;
|
||||||
|
|
||||||
GUILayout.Label("Enter code here as though it is a method body:", null);
|
GUIUnstrip.Label("Enter code here as though it is a method body:");
|
||||||
|
|
||||||
inputAreaScroll = GUIUnstrip.BeginScrollView(inputAreaScroll, new GUILayoutOption[] { GUILayout.Height(250) });
|
inputAreaScroll = GUIUnstrip.BeginScrollView(inputAreaScroll, new GUILayoutOption[] { GUILayout.Height(250) });
|
||||||
|
|
||||||
MethodInput = GUILayout.TextArea(MethodInput, new GUILayoutOption[] { GUILayout.ExpandHeight(true) });
|
MethodInput = GUIUnstrip.TextArea(MethodInput, new GUILayoutOption[] { GUILayout.ExpandHeight(true) });
|
||||||
|
|
||||||
GUIUnstrip.EndScrollView();
|
GUIUnstrip.EndScrollView();
|
||||||
|
|
||||||
if (GUILayout.Button("<color=cyan><b>Execute</b></color>", null))
|
if (GUIUnstrip.Button("<color=cyan><b>Execute</b></color>"))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -157,16 +157,16 @@ MelonLogger.Log(""hello world"");";
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GUILayout.Label("<b>Using directives:</b>", null);
|
GUIUnstrip.Label("<b>Using directives:</b>");
|
||||||
|
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
GUILayout.Label("Add namespace:", new GUILayoutOption[] { GUILayout.Width(105) });
|
GUIUnstrip.Label("Add namespace:", new GUILayoutOption[] { GUILayout.Width(105) });
|
||||||
UsingInput = GUILayout.TextField(UsingInput, new GUILayoutOption[] { GUILayout.Width(150) });
|
UsingInput = GUIUnstrip.TextField(UsingInput, new GUILayoutOption[] { GUILayout.Width(150) });
|
||||||
if (GUILayout.Button("<b><color=lime>Add</color></b>", new GUILayoutOption[] { GUILayout.Width(120) }))
|
if (GUIUnstrip.Button("<b><color=lime>Add</color></b>", new GUILayoutOption[] { GUILayout.Width(120) }))
|
||||||
{
|
{
|
||||||
AddUsing(UsingInput);
|
AddUsing(UsingInput);
|
||||||
}
|
}
|
||||||
if (GUILayout.Button("<b><color=red>Clear All</color></b>", new GUILayoutOption[] { GUILayout.Width(120) }))
|
if (GUIUnstrip.Button("<b><color=red>Clear All</color></b>", new GUILayoutOption[] { GUILayout.Width(120) }))
|
||||||
{
|
{
|
||||||
ResetConsole();
|
ResetConsole();
|
||||||
}
|
}
|
||||||
@ -174,7 +174,7 @@ MelonLogger.Log(""hello world"");";
|
|||||||
|
|
||||||
foreach (var asm in UsingDirectives)
|
foreach (var asm in UsingDirectives)
|
||||||
{
|
{
|
||||||
GUILayout.Label(AsmToUsing(asm, true), null);
|
GUIUnstrip.Label(AsmToUsing(asm, true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -226,19 +226,19 @@ namespace Explorer
|
|||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
|
|
||||||
// Current Scene label
|
// Current Scene label
|
||||||
GUILayout.Label("Current Scene:", new GUILayoutOption[] { GUILayout.Width(120) });
|
GUIUnstrip.Label("Current Scene:", new GUILayoutOption[] { GUILayout.Width(120) });
|
||||||
SceneChangeButtons();
|
SceneChangeButtons();
|
||||||
GUILayout.Label("<color=cyan>" + m_currentScene + "</color>", null); //new GUILayoutOption[] { GUILayout.Width(250) });
|
GUIUnstrip.Label("<color=cyan>" + m_currentScene + "</color>");
|
||||||
|
|
||||||
GUIUnstrip.EndHorizontal();
|
GUIUnstrip.EndHorizontal();
|
||||||
|
|
||||||
// ----- GameObject Search -----
|
// ----- GameObject Search -----
|
||||||
GUIUnstrip.BeginHorizontal(GUI.skin.box, null);
|
GUIUnstrip.BeginHorizontal(GUI.skin.box, null);
|
||||||
GUILayout.Label("<b>Search Scene:</b>", new GUILayoutOption[] { GUILayout.Width(100) });
|
GUIUnstrip.Label("<b>Search Scene:</b>", new GUILayoutOption[] { GUILayout.Width(100) });
|
||||||
|
|
||||||
m_searchInput = GUILayout.TextField(m_searchInput, null);
|
m_searchInput = GUIUnstrip.TextField(m_searchInput);
|
||||||
|
|
||||||
if (GUILayout.Button("Search", new GUILayoutOption[] { GUILayout.Width(80) }))
|
if (GUIUnstrip.Button("Search", new GUILayoutOption[] { GUILayout.Width(80) }))
|
||||||
{
|
{
|
||||||
Search();
|
Search();
|
||||||
}
|
}
|
||||||
@ -255,11 +255,11 @@ namespace Explorer
|
|||||||
if (scenes.Count > 1)
|
if (scenes.Count > 1)
|
||||||
{
|
{
|
||||||
int changeWanted = 0;
|
int changeWanted = 0;
|
||||||
if (GUILayout.Button("<", new GUILayoutOption[] { GUILayout.Width(30) }))
|
if (GUIUnstrip.Button("<", new GUILayoutOption[] { GUILayout.Width(30) }))
|
||||||
{
|
{
|
||||||
changeWanted = -1;
|
changeWanted = -1;
|
||||||
}
|
}
|
||||||
if (GUILayout.Button(">", new GUILayoutOption[] { GUILayout.Width(30) }))
|
if (GUIUnstrip.Button(">", new GUILayoutOption[] { GUILayout.Width(30) }))
|
||||||
{
|
{
|
||||||
changeWanted = 1;
|
changeWanted = 1;
|
||||||
}
|
}
|
||||||
@ -288,7 +288,7 @@ namespace Explorer
|
|||||||
|
|
||||||
if (Pages.ItemCount > Pages.ItemsPerPage)
|
if (Pages.ItemCount > Pages.ItemsPerPage)
|
||||||
{
|
{
|
||||||
if (GUILayout.Button("< Prev", new GUILayoutOption[] { GUILayout.Width(80) }))
|
if (GUIUnstrip.Button("< Prev", new GUILayoutOption[] { GUILayout.Width(80) }))
|
||||||
{
|
{
|
||||||
Pages.TurnPage(Turn.Left, ref this.scroll);
|
Pages.TurnPage(Turn.Left, ref this.scroll);
|
||||||
|
|
||||||
@ -297,7 +297,7 @@ namespace Explorer
|
|||||||
|
|
||||||
Pages.CurrentPageLabel();
|
Pages.CurrentPageLabel();
|
||||||
|
|
||||||
if (GUILayout.Button("Next >", new GUILayoutOption[] { GUILayout.Width(80) }))
|
if (GUIUnstrip.Button("Next >", new GUILayoutOption[] { GUILayout.Width(80) }))
|
||||||
{
|
{
|
||||||
Pages.TurnPage(Turn.Right, ref this.scroll);
|
Pages.TurnPage(Turn.Right, ref this.scroll);
|
||||||
|
|
||||||
@ -314,13 +314,13 @@ namespace Explorer
|
|||||||
if (m_currentTransform != null)
|
if (m_currentTransform != null)
|
||||||
{
|
{
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
if (GUILayout.Button("<-", new GUILayoutOption[] { GUILayout.Width(35) }))
|
if (GUIUnstrip.Button("<-", new GUILayoutOption[] { GUILayout.Width(35) }))
|
||||||
{
|
{
|
||||||
TraverseUp();
|
TraverseUp();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GUILayout.Label("<color=cyan>" + m_currentTransform.GetGameObjectPath() + "</color>",
|
GUIUnstrip.Label("<color=cyan>" + m_currentTransform.GetGameObjectPath() + "</color>",
|
||||||
new GUILayoutOption[] { GUILayout.Width(MainMenu.MainRect.width - 187f) });
|
new GUILayoutOption[] { GUILayout.Width(MainMenu.MainRect.width - 187f) });
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -330,11 +330,11 @@ namespace Explorer
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GUILayout.Label("Scene Root GameObjects:", null);
|
GUIUnstrip.Label("Scene Root GameObjects:");
|
||||||
|
|
||||||
if (m_getRootObjectsFailed)
|
if (m_getRootObjectsFailed)
|
||||||
{
|
{
|
||||||
if (GUILayout.Button("Update Root Object List (auto-update failed!)", null))
|
if (GUIUnstrip.Button("Update Root Object List (auto-update failed!)"))
|
||||||
{
|
{
|
||||||
Update_Impl(true);
|
Update_Impl(true);
|
||||||
}
|
}
|
||||||
@ -359,7 +359,7 @@ namespace Explorer
|
|||||||
}
|
}
|
||||||
|
|
||||||
label += "</i></color>";
|
label += "</i></color>";
|
||||||
GUILayout.Label(label, null);
|
GUIUnstrip.Label(label);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -377,12 +377,12 @@ namespace Explorer
|
|||||||
|
|
||||||
private void DrawSearchResultsList()
|
private void DrawSearchResultsList()
|
||||||
{
|
{
|
||||||
if (GUILayout.Button("<- Cancel Search", new GUILayoutOption[] { GUILayout.Width(150) }))
|
if (GUIUnstrip.Button("<- Cancel Search", new GUILayoutOption[] { GUILayout.Width(150) }))
|
||||||
{
|
{
|
||||||
CancelSearch();
|
CancelSearch();
|
||||||
}
|
}
|
||||||
|
|
||||||
GUILayout.Label("Search Results:", null);
|
GUIUnstrip.Label("Search Results:");
|
||||||
|
|
||||||
if (m_searchResults.Count > 0)
|
if (m_searchResults.Count > 0)
|
||||||
{
|
{
|
||||||
@ -404,13 +404,13 @@ namespace Explorer
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GUILayout.Label("<i><color=red>Null or destroyed!</color></i>", null);
|
GUIUnstrip.Label("<i><color=red>Null or destroyed!</color></i>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GUILayout.Label("<color=red><i>No results found!</i></color>", null);
|
GUIUnstrip.Label("<color=red><i>No results found!</i></color>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,8 +85,8 @@ namespace Explorer
|
|||||||
{
|
{
|
||||||
// helpers
|
// helpers
|
||||||
GUIUnstrip.BeginHorizontal(GUI.skin.box, null);
|
GUIUnstrip.BeginHorizontal(GUI.skin.box, null);
|
||||||
GUILayout.Label("<b><color=orange>Helpers</color></b>", new GUILayoutOption[] { GUILayout.Width(70) });
|
GUIUnstrip.Label("<b><color=orange>Helpers</color></b>", new GUILayoutOption[] { GUILayout.Width(70) });
|
||||||
if (GUILayout.Button("Find Static Instances", new GUILayoutOption[] { GUILayout.Width(180) }))
|
if (GUIUnstrip.Button("Find Static Instances", new GUILayoutOption[] { GUILayout.Width(180) }))
|
||||||
{
|
{
|
||||||
//m_searchResults = GetInstanceClassScanner().ToList();
|
//m_searchResults = GetInstanceClassScanner().ToList();
|
||||||
CacheResults(GetInstanceClassScanner());
|
CacheResults(GetInstanceClassScanner());
|
||||||
@ -100,7 +100,7 @@ namespace Explorer
|
|||||||
GUIUnstrip.BeginVertical(GUI.skin.box, null);
|
GUIUnstrip.BeginVertical(GUI.skin.box, null);
|
||||||
|
|
||||||
GUI.skin.label.alignment = TextAnchor.MiddleCenter;
|
GUI.skin.label.alignment = TextAnchor.MiddleCenter;
|
||||||
GUILayout.Label("<b><color=orange>Results </color></b>" + " (" + m_searchResults.Count + ")", null);
|
GUIUnstrip.Label("<b><color=orange>Results </color></b>" + " (" + m_searchResults.Count + ")");
|
||||||
GUI.skin.label.alignment = TextAnchor.UpperLeft;
|
GUI.skin.label.alignment = TextAnchor.UpperLeft;
|
||||||
|
|
||||||
int count = m_searchResults.Count;
|
int count = m_searchResults.Count;
|
||||||
@ -115,14 +115,14 @@ namespace Explorer
|
|||||||
|
|
||||||
if (Pages.ItemCount > Pages.ItemsPerPage)
|
if (Pages.ItemCount > Pages.ItemsPerPage)
|
||||||
{
|
{
|
||||||
if (GUILayout.Button("< Prev", new GUILayoutOption[] { GUILayout.Width(80) }))
|
if (GUIUnstrip.Button("< Prev", new GUILayoutOption[] { GUILayout.Width(80) }))
|
||||||
{
|
{
|
||||||
Pages.TurnPage(Turn.Left, ref this.resultsScroll);
|
Pages.TurnPage(Turn.Left, ref this.resultsScroll);
|
||||||
}
|
}
|
||||||
|
|
||||||
Pages.CurrentPageLabel();
|
Pages.CurrentPageLabel();
|
||||||
|
|
||||||
if (GUILayout.Button("Next >", new GUILayoutOption[] { GUILayout.Width(80) }))
|
if (GUIUnstrip.Button("Next >", new GUILayoutOption[] { GUILayout.Width(80) }))
|
||||||
{
|
{
|
||||||
Pages.TurnPage(Turn.Right, ref this.resultsScroll);
|
Pages.TurnPage(Turn.Right, ref this.resultsScroll);
|
||||||
}
|
}
|
||||||
@ -146,7 +146,7 @@ namespace Explorer
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GUILayout.Label("<color=red><i>No results found!</i></color>", null);
|
GUIUnstrip.Label("<color=red><i>No results found!</i></color>");
|
||||||
}
|
}
|
||||||
|
|
||||||
GUIUnstrip.EndScrollView();
|
GUIUnstrip.EndScrollView();
|
||||||
@ -164,19 +164,19 @@ namespace Explorer
|
|||||||
|
|
||||||
// ----- GameObject Search -----
|
// ----- GameObject Search -----
|
||||||
GUI.skin.label.alignment = TextAnchor.MiddleCenter;
|
GUI.skin.label.alignment = TextAnchor.MiddleCenter;
|
||||||
GUILayout.Label("<b><color=orange>Search</color></b>", null);
|
GUIUnstrip.Label("<b><color=orange>Search</color></b>");
|
||||||
GUI.skin.label.alignment = TextAnchor.UpperLeft;
|
GUI.skin.label.alignment = TextAnchor.UpperLeft;
|
||||||
|
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
|
|
||||||
GUILayout.Label("Name Contains:", new GUILayoutOption[] { GUILayout.Width(100) });
|
GUIUnstrip.Label("Name Contains:", new GUILayoutOption[] { GUILayout.Width(100) });
|
||||||
m_searchInput = GUILayout.TextField(m_searchInput, new GUILayoutOption[] { GUILayout.Width(200) });
|
m_searchInput = GUIUnstrip.TextField(m_searchInput, new GUILayoutOption[] { GUILayout.Width(200) });
|
||||||
|
|
||||||
GUIUnstrip.EndHorizontal();
|
GUIUnstrip.EndHorizontal();
|
||||||
|
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
|
|
||||||
GUILayout.Label("Class Filter:", new GUILayoutOption[] { GUILayout.Width(100) });
|
GUIUnstrip.Label("Class Filter:", new GUILayoutOption[] { GUILayout.Width(100) });
|
||||||
ClassFilterToggle(TypeFilter.Object, "Object");
|
ClassFilterToggle(TypeFilter.Object, "Object");
|
||||||
ClassFilterToggle(TypeFilter.GameObject, "GameObject");
|
ClassFilterToggle(TypeFilter.GameObject, "GameObject");
|
||||||
ClassFilterToggle(TypeFilter.Component, "Component");
|
ClassFilterToggle(TypeFilter.Component, "Component");
|
||||||
@ -186,21 +186,21 @@ namespace Explorer
|
|||||||
{
|
{
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
GUI.skin.label.alignment = TextAnchor.MiddleRight;
|
GUI.skin.label.alignment = TextAnchor.MiddleRight;
|
||||||
GUILayout.Label("Custom Class:", new GUILayoutOption[] { GUILayout.Width(250) });
|
GUIUnstrip.Label("Custom Class:", new GUILayoutOption[] { GUILayout.Width(250) });
|
||||||
GUI.skin.label.alignment = TextAnchor.UpperLeft;
|
GUI.skin.label.alignment = TextAnchor.UpperLeft;
|
||||||
m_typeInput = GUILayout.TextField(m_typeInput, new GUILayoutOption[] { GUILayout.Width(250) });
|
m_typeInput = GUIUnstrip.TextField(m_typeInput, new GUILayoutOption[] { GUILayout.Width(250) });
|
||||||
GUIUnstrip.EndHorizontal();
|
GUIUnstrip.EndHorizontal();
|
||||||
}
|
}
|
||||||
|
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
GUILayout.Label("Scene Filter:", new GUILayoutOption[] { GUILayout.Width(100) });
|
GUIUnstrip.Label("Scene Filter:", new GUILayoutOption[] { GUILayout.Width(100) });
|
||||||
SceneFilterToggle(SceneFilter.Any, "Any", 60);
|
SceneFilterToggle(SceneFilter.Any, "Any", 60);
|
||||||
SceneFilterToggle(SceneFilter.This, "This Scene", 100);
|
SceneFilterToggle(SceneFilter.This, "This Scene", 100);
|
||||||
SceneFilterToggle(SceneFilter.DontDestroy, "DontDestroyOnLoad", 140);
|
SceneFilterToggle(SceneFilter.DontDestroy, "DontDestroyOnLoad", 140);
|
||||||
SceneFilterToggle(SceneFilter.None, "No Scene", 80);
|
SceneFilterToggle(SceneFilter.None, "No Scene", 80);
|
||||||
GUIUnstrip.EndHorizontal();
|
GUIUnstrip.EndHorizontal();
|
||||||
|
|
||||||
if (GUILayout.Button("<b><color=cyan>Search</color></b>", null))
|
if (GUIUnstrip.Button("<b><color=cyan>Search</color></b>"))
|
||||||
{
|
{
|
||||||
Search();
|
Search();
|
||||||
}
|
}
|
||||||
@ -218,7 +218,7 @@ namespace Explorer
|
|||||||
{
|
{
|
||||||
GUI.color = Color.white;
|
GUI.color = Color.white;
|
||||||
}
|
}
|
||||||
if (GUILayout.Button(label, new GUILayoutOption[] { GUILayout.Width(100) }))
|
if (GUIUnstrip.Button(label, new GUILayoutOption[] { GUILayout.Width(100) }))
|
||||||
{
|
{
|
||||||
TypeMode = mode;
|
TypeMode = mode;
|
||||||
}
|
}
|
||||||
@ -235,7 +235,7 @@ namespace Explorer
|
|||||||
{
|
{
|
||||||
GUI.color = Color.white;
|
GUI.color = Color.white;
|
||||||
}
|
}
|
||||||
if (GUILayout.Button(label, new GUILayoutOption[] { GUILayout.Width(width) }))
|
if (GUIUnstrip.Button(label, new GUILayoutOption[] { GUILayout.Width(width) }))
|
||||||
{
|
{
|
||||||
SceneMode = mode;
|
SceneMode = mode;
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ namespace Explorer
|
|||||||
// helper for "Instantiate" button on UnityEngine.Objects
|
// helper for "Instantiate" button on UnityEngine.Objects
|
||||||
public static void InstantiateButton(Object obj, float width = 100)
|
public static void InstantiateButton(Object obj, float width = 100)
|
||||||
{
|
{
|
||||||
if (GUILayout.Button("Instantiate", new GUILayoutOption[] { GUILayout.Width(width) }))
|
if (GUIUnstrip.Button("Instantiate", new GUILayoutOption[] { GUILayout.Width(width) }))
|
||||||
{
|
{
|
||||||
var newobj = Object.Instantiate(obj);
|
var newobj = Object.Instantiate(obj);
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ namespace Explorer
|
|||||||
|
|
||||||
if (!obj)
|
if (!obj)
|
||||||
{
|
{
|
||||||
GUILayout.Label("<i><color=red>null</color></i>", null);
|
GUIUnstrip.Label("<i><color=red>null</color></i>");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ namespace Explorer
|
|||||||
|
|
||||||
GUI.color = activeColor;
|
GUI.color = activeColor;
|
||||||
|
|
||||||
enabled = GUILayout.Toggle(enabled, "", new GUILayoutOption[] { GUILayout.Width(18) });
|
enabled = GUIUnstrip.Toggle(enabled, "", new GUILayoutOption[] { GUILayout.Width(18) });
|
||||||
if (obj.activeSelf != enabled)
|
if (obj.activeSelf != enabled)
|
||||||
{
|
{
|
||||||
obj.SetActive(enabled);
|
obj.SetActive(enabled);
|
||||||
@ -81,7 +81,7 @@ namespace Explorer
|
|||||||
|
|
||||||
// ------- actual button ---------
|
// ------- actual button ---------
|
||||||
|
|
||||||
if (GUILayout.Button(label, new GUILayoutOption[] { GUILayout.Height(22), GUILayout.Width(width) }))
|
if (GUIUnstrip.Button(label, new GUILayoutOption[] { GUILayout.Height(22), GUILayout.Width(width) }))
|
||||||
{
|
{
|
||||||
if (specialInspectMethod != null)
|
if (specialInspectMethod != null)
|
||||||
{
|
{
|
||||||
@ -108,7 +108,7 @@ namespace Explorer
|
|||||||
|
|
||||||
public static void SmallInspectButton(object obj)
|
public static void SmallInspectButton(object obj)
|
||||||
{
|
{
|
||||||
if (GUILayout.Button("Inspect", null))
|
if (GUIUnstrip.Button("Inspect"))
|
||||||
{
|
{
|
||||||
WindowManager.InspectObject(obj, out bool _);
|
WindowManager.InspectObject(obj, out bool _);
|
||||||
}
|
}
|
@ -38,7 +38,7 @@ namespace Explorer
|
|||||||
var orig = GUI.color;
|
var orig = GUI.color;
|
||||||
|
|
||||||
GUI.color = _color;
|
GUI.color = _color;
|
||||||
GUILayout.Box(GUIContent.none, !small ? HorizontalBar : HorizontalBarSmall, null);
|
GUIUnstrip.Box(GUIContent.none, !small ? HorizontalBar : HorizontalBarSmall, null);
|
||||||
|
|
||||||
GUI.color = orig;
|
GUI.color = orig;
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ namespace Explorer
|
|||||||
|
|
||||||
public GameObject TargetGO;
|
public GameObject TargetGO;
|
||||||
|
|
||||||
private bool m_hideControls;
|
private static bool m_hideControls;
|
||||||
|
|
||||||
// gui element holders
|
// gui element holders
|
||||||
private string m_name;
|
private string m_name;
|
||||||
@ -218,37 +218,37 @@ namespace Explorer
|
|||||||
scroll = GUIUnstrip.BeginScrollView(scroll);
|
scroll = GUIUnstrip.BeginScrollView(scroll);
|
||||||
|
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
GUILayout.Label("Scene: <color=cyan>" + (m_scene == "" ? "n/a" : m_scene) + "</color>", null);
|
GUIUnstrip.Label("Scene: <color=cyan>" + (m_scene == "" ? "n/a" : m_scene) + "</color>");
|
||||||
if (m_scene == UnityHelpers.ActiveSceneName)
|
if (m_scene == UnityHelpers.ActiveSceneName)
|
||||||
{
|
{
|
||||||
if (GUILayout.Button("<color=#00FF00>Send to Scene View</color>", new GUILayoutOption[] { GUILayout.Width(150) }))
|
if (GUIUnstrip.Button("<color=#00FF00>Send to Scene View</color>", new GUILayoutOption[] { GUILayout.Width(150) }))
|
||||||
{
|
{
|
||||||
ScenePage.Instance.SetTransformTarget(TargetGO.transform);
|
ScenePage.Instance.SetTransformTarget(TargetGO.transform);
|
||||||
MainMenu.SetCurrentPage(0);
|
MainMenu.SetCurrentPage(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (GUILayout.Button("Reflection Inspect", new GUILayoutOption[] { GUILayout.Width(150) }))
|
if (GUIUnstrip.Button("Reflection Inspect", new GUILayoutOption[] { GUILayout.Width(150) }))
|
||||||
{
|
{
|
||||||
WindowManager.InspectObject(Target, out _, true);
|
WindowManager.InspectObject(Target, out _, true);
|
||||||
}
|
}
|
||||||
GUIUnstrip.EndHorizontal();
|
GUIUnstrip.EndHorizontal();
|
||||||
|
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
GUILayout.Label("Path:", new GUILayoutOption[] { GUILayout.Width(50) });
|
GUIUnstrip.Label("Path:", new GUILayoutOption[] { GUILayout.Width(50) });
|
||||||
string pathlabel = TargetGO.transform.GetGameObjectPath();
|
string pathlabel = TargetGO.transform.GetGameObjectPath();
|
||||||
if (TargetGO.transform.parent != null)
|
if (TargetGO.transform.parent != null)
|
||||||
{
|
{
|
||||||
if (GUILayout.Button("<-", new GUILayoutOption[] { GUILayout.Width(35) }))
|
if (GUIUnstrip.Button("<-", new GUILayoutOption[] { GUILayout.Width(35) }))
|
||||||
{
|
{
|
||||||
InspectGameObject(TargetGO.transform.parent);
|
InspectGameObject(TargetGO.transform.parent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GUILayout.TextArea(pathlabel, null);
|
GUIUnstrip.TextArea(pathlabel);
|
||||||
GUIUnstrip.EndHorizontal();
|
GUIUnstrip.EndHorizontal();
|
||||||
|
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
GUILayout.Label("Name:", new GUILayoutOption[] { GUILayout.Width(50) });
|
GUIUnstrip.Label("Name:", new GUILayoutOption[] { GUILayout.Width(50) });
|
||||||
GUILayout.TextArea(m_name, null);
|
GUIUnstrip.TextArea(m_name);
|
||||||
GUIUnstrip.EndHorizontal();
|
GUIUnstrip.EndHorizontal();
|
||||||
|
|
||||||
// --- Horizontal Columns section ---
|
// --- Horizontal Columns section ---
|
||||||
@ -286,7 +286,7 @@ namespace Explorer
|
|||||||
GUIUnstrip.BeginVertical(GUI.skin.box, null);
|
GUIUnstrip.BeginVertical(GUI.skin.box, null);
|
||||||
m_transformScroll = GUIUnstrip.BeginScrollView(m_transformScroll);
|
m_transformScroll = GUIUnstrip.BeginScrollView(m_transformScroll);
|
||||||
|
|
||||||
GUILayout.Label("<b><size=15>Children</size></b>", null);
|
GUIUnstrip.Label("<b><size=15>Children</size></b>");
|
||||||
|
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
ChildPages.DrawLimitInputArea();
|
ChildPages.DrawLimitInputArea();
|
||||||
@ -298,11 +298,11 @@ namespace Explorer
|
|||||||
GUIUnstrip.EndHorizontal();
|
GUIUnstrip.EndHorizontal();
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
|
|
||||||
if (GUILayout.Button("< Prev", new GUILayoutOption[] { GUILayout.Width(80) }))
|
if (GUIUnstrip.Button("< Prev", new GUILayoutOption[] { GUILayout.Width(80) }))
|
||||||
{
|
{
|
||||||
ChildPages.TurnPage(Turn.Left, ref this.m_transformScroll);
|
ChildPages.TurnPage(Turn.Left, ref this.m_transformScroll);
|
||||||
}
|
}
|
||||||
if (GUILayout.Button("Next >", new GUILayoutOption[] { GUILayout.Width(80) }))
|
if (GUIUnstrip.Button("Next >", new GUILayoutOption[] { GUILayout.Width(80) }))
|
||||||
{
|
{
|
||||||
ChildPages.TurnPage(Turn.Right, ref this.m_transformScroll);
|
ChildPages.TurnPage(Turn.Right, ref this.m_transformScroll);
|
||||||
}
|
}
|
||||||
@ -319,7 +319,7 @@ namespace Explorer
|
|||||||
|
|
||||||
if (!obj)
|
if (!obj)
|
||||||
{
|
{
|
||||||
GUILayout.Label("null", null);
|
GUIUnstrip.Label("null");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -328,7 +328,7 @@ namespace Explorer
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GUILayout.Label("<i>None</i>", null);
|
GUIUnstrip.Label("<i>None</i>");
|
||||||
}
|
}
|
||||||
|
|
||||||
GUIUnstrip.EndScrollView();
|
GUIUnstrip.EndScrollView();
|
||||||
@ -339,7 +339,7 @@ namespace Explorer
|
|||||||
{
|
{
|
||||||
GUIUnstrip.BeginVertical(GUI.skin.box, null);
|
GUIUnstrip.BeginVertical(GUI.skin.box, null);
|
||||||
m_compScroll = GUIUnstrip.BeginScrollView(m_compScroll);
|
m_compScroll = GUIUnstrip.BeginScrollView(m_compScroll);
|
||||||
GUILayout.Label("<b><size=15>Components</size></b>", null);
|
GUIUnstrip.Label("<b><size=15>Components</size></b>");
|
||||||
|
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
CompPages.DrawLimitInputArea();
|
CompPages.DrawLimitInputArea();
|
||||||
@ -351,11 +351,11 @@ namespace Explorer
|
|||||||
GUIUnstrip.EndHorizontal();
|
GUIUnstrip.EndHorizontal();
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
|
|
||||||
if (GUILayout.Button("< Prev", new GUILayoutOption[] { GUILayout.Width(80) }))
|
if (GUIUnstrip.Button("< Prev", new GUILayoutOption[] { GUILayout.Width(80) }))
|
||||||
{
|
{
|
||||||
CompPages.TurnPage(Turn.Left, ref this.m_compScroll);
|
CompPages.TurnPage(Turn.Left, ref this.m_compScroll);
|
||||||
}
|
}
|
||||||
if (GUILayout.Button("Next >", new GUILayoutOption[] { GUILayout.Width(80) }))
|
if (GUIUnstrip.Button("Next >", new GUILayoutOption[] { GUILayout.Width(80) }))
|
||||||
{
|
{
|
||||||
CompPages.TurnPage(Turn.Right, ref this.m_compScroll);
|
CompPages.TurnPage(Turn.Right, ref this.m_compScroll);
|
||||||
}
|
}
|
||||||
@ -363,8 +363,9 @@ namespace Explorer
|
|||||||
GUIUnstrip.EndHorizontal();
|
GUIUnstrip.EndHorizontal();
|
||||||
|
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
m_addComponentInput = GUILayout.TextField(m_addComponentInput, new GUILayoutOption[] { GUILayout.Width(130) });
|
var width = m_rect.width / 2 - 115f;
|
||||||
if (GUILayout.Button("Add Comp", null))
|
m_addComponentInput = GUIUnstrip.TextField(m_addComponentInput, new GUILayoutOption[] { GUILayout.Width(width) });
|
||||||
|
if (GUIUnstrip.Button("Add Comp"))
|
||||||
{
|
{
|
||||||
if (ReflectionHelpers.GetTypeByName(m_addComponentInput) is Type compType)
|
if (ReflectionHelpers.GetTypeByName(m_addComponentInput) is Type compType)
|
||||||
{
|
{
|
||||||
@ -411,11 +412,11 @@ namespace Explorer
|
|||||||
{
|
{
|
||||||
GUIUnstrip.Space(26);
|
GUIUnstrip.Space(26);
|
||||||
}
|
}
|
||||||
if (GUILayout.Button("<color=cyan>" + ilType.Name + "</color>", new GUILayoutOption[] { GUILayout.Width(m_rect.width / 2 - 100) }))
|
if (GUIUnstrip.Button("<color=cyan>" + ilType.Name + "</color>", new GUILayoutOption[] { GUILayout.Width(m_rect.width / 2 - 100) }))
|
||||||
{
|
{
|
||||||
ReflectObject(component);
|
ReflectObject(component);
|
||||||
}
|
}
|
||||||
if (GUILayout.Button("<color=red>-</color>", new GUILayoutOption[] { GUILayout.Width(20) }))
|
if (GUIUnstrip.Button("<color=red>-</color>", new GUILayoutOption[] { GUILayout.Width(20) }))
|
||||||
{
|
{
|
||||||
m_cachedDestroyList.Add(component);
|
m_cachedDestroyList.Add(component);
|
||||||
}
|
}
|
||||||
@ -453,7 +454,7 @@ namespace Explorer
|
|||||||
|
|
||||||
// ------ toggle active button ------
|
// ------ toggle active button ------
|
||||||
|
|
||||||
_enabled = GUILayout.Toggle(_enabled, "", new GUILayoutOption[] { GUILayout.Width(18) });
|
_enabled = GUIUnstrip.Toggle(_enabled, "", new GUILayoutOption[] { GUILayout.Width(18) });
|
||||||
if (obj.enabled != _enabled)
|
if (obj.enabled != _enabled)
|
||||||
{
|
{
|
||||||
obj.enabled = _enabled;
|
obj.enabled = _enabled;
|
||||||
@ -466,8 +467,8 @@ namespace Explorer
|
|||||||
if (m_hideControls)
|
if (m_hideControls)
|
||||||
{
|
{
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
GUILayout.Label("<b><size=15>GameObject Controls</size></b>", new GUILayoutOption[] { GUILayout.Width(200) });
|
GUIUnstrip.Label("<b><size=15>GameObject Controls</size></b>", new GUILayoutOption[] { GUILayout.Width(200) });
|
||||||
if (GUILayout.Button("^ Show ^", new GUILayoutOption[] { GUILayout.Width(75) }))
|
if (GUIUnstrip.Button("^ Show ^", new GUILayoutOption[] { GUILayout.Width(75) }))
|
||||||
{
|
{
|
||||||
m_hideControls = false;
|
m_hideControls = false;
|
||||||
}
|
}
|
||||||
@ -479,8 +480,8 @@ namespace Explorer
|
|||||||
GUIUnstrip.BeginVertical(GUI.skin.box, new GUILayoutOption[] { GUILayout.Width(520) });
|
GUIUnstrip.BeginVertical(GUI.skin.box, new GUILayoutOption[] { GUILayout.Width(520) });
|
||||||
|
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
GUILayout.Label("<b><size=15>GameObject Controls</size></b>", new GUILayoutOption[] { GUILayout.Width(200) });
|
GUIUnstrip.Label("<b><size=15>GameObject Controls</size></b>", new GUILayoutOption[] { GUILayout.Width(200) });
|
||||||
if (GUILayout.Button("v Hide v", new GUILayoutOption[] { GUILayout.Width(75) }))
|
if (GUIUnstrip.Button("v Hide v", new GUILayoutOption[] { GUILayout.Width(75) }))
|
||||||
{
|
{
|
||||||
m_hideControls = true;
|
m_hideControls = true;
|
||||||
}
|
}
|
||||||
@ -488,20 +489,20 @@ namespace Explorer
|
|||||||
|
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
bool m_active = TargetGO.activeSelf;
|
bool m_active = TargetGO.activeSelf;
|
||||||
m_active = GUILayout.Toggle(m_active, (m_active ? "<color=lime>Enabled " : "<color=red>Disabled") + "</color>",
|
m_active = GUIUnstrip.Toggle(m_active, (m_active ? "<color=lime>Enabled " : "<color=red>Disabled") + "</color>",
|
||||||
new GUILayoutOption[] { GUILayout.Width(80) });
|
new GUILayoutOption[] { GUILayout.Width(80) });
|
||||||
if (TargetGO.activeSelf != m_active) { TargetGO.SetActive(m_active); }
|
if (TargetGO.activeSelf != m_active) { TargetGO.SetActive(m_active); }
|
||||||
|
|
||||||
UIHelpers.InstantiateButton(TargetGO, 100);
|
UIHelpers.InstantiateButton(TargetGO, 100);
|
||||||
|
|
||||||
if (GUILayout.Button("Set DontDestroyOnLoad", new GUILayoutOption[] { GUILayout.Width(170) }))
|
if (GUIUnstrip.Button("Set DontDestroyOnLoad", new GUILayoutOption[] { GUILayout.Width(170) }))
|
||||||
{
|
{
|
||||||
GameObject.DontDestroyOnLoad(TargetGO);
|
GameObject.DontDestroyOnLoad(TargetGO);
|
||||||
TargetGO.hideFlags |= HideFlags.DontUnloadUnusedAsset;
|
TargetGO.hideFlags |= HideFlags.DontUnloadUnusedAsset;
|
||||||
}
|
}
|
||||||
|
|
||||||
var lbl = m_freeze ? "<color=lime>Unfreeze</color>" : "<color=orange>Freeze Pos/Rot</color>";
|
var lbl = m_freeze ? "<color=lime>Unfreeze</color>" : "<color=orange>Freeze Pos/Rot</color>";
|
||||||
if (GUILayout.Button(lbl, new GUILayoutOption[] { GUILayout.Width(110) }))
|
if (GUIUnstrip.Button(lbl, new GUILayoutOption[] { GUILayout.Width(110) }))
|
||||||
{
|
{
|
||||||
m_freeze = !m_freeze;
|
m_freeze = !m_freeze;
|
||||||
if (m_freeze)
|
if (m_freeze)
|
||||||
@ -513,8 +514,8 @@ namespace Explorer
|
|||||||
GUIUnstrip.EndHorizontal();
|
GUIUnstrip.EndHorizontal();
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
|
|
||||||
m_setParentInput = GUILayout.TextField(m_setParentInput, null);
|
m_setParentInput = GUIUnstrip.TextField(m_setParentInput);
|
||||||
if (GUILayout.Button("Set Parent", new GUILayoutOption[] { GUILayout.Width(80) }))
|
if (GUIUnstrip.Button("Set Parent", new GUILayoutOption[] { GUILayout.Width(80) }))
|
||||||
{
|
{
|
||||||
if (GameObject.Find(m_setParentInput) is GameObject newparent)
|
if (GameObject.Find(m_setParentInput) is GameObject newparent)
|
||||||
{
|
{
|
||||||
@ -526,7 +527,7 @@ namespace Explorer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GUILayout.Button("Detach from parent", new GUILayoutOption[] { GUILayout.Width(160) }))
|
if (GUIUnstrip.Button("Detach from parent", new GUILayoutOption[] { GUILayout.Width(160) }))
|
||||||
{
|
{
|
||||||
TargetGO.transform.parent = null;
|
TargetGO.transform.parent = null;
|
||||||
}
|
}
|
||||||
@ -539,7 +540,7 @@ namespace Explorer
|
|||||||
m_cachedInput[2] = TranslateControl(TranslateType.Scale, ref m_scaleAmount, false);
|
m_cachedInput[2] = TranslateControl(TranslateType.Scale, ref m_scaleAmount, false);
|
||||||
|
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
if (GUILayout.Button("<color=lime>Apply to Transform</color>", null) || m_autoApplyTransform)
|
if (GUIUnstrip.Button("<color=lime>Apply to Transform</color>") || m_autoApplyTransform)
|
||||||
{
|
{
|
||||||
if (m_localContext)
|
if (m_localContext)
|
||||||
{
|
{
|
||||||
@ -558,7 +559,7 @@ namespace Explorer
|
|||||||
UpdateFreeze();
|
UpdateFreeze();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (GUILayout.Button("<color=lime>Update from Transform</color>", null) || m_autoUpdateTransform)
|
if (GUIUnstrip.Button("<color=lime>Update from Transform</color>") || m_autoUpdateTransform)
|
||||||
{
|
{
|
||||||
CacheTransformValues();
|
CacheTransformValues();
|
||||||
}
|
}
|
||||||
@ -570,7 +571,7 @@ namespace Explorer
|
|||||||
GUIUnstrip.EndHorizontal();
|
GUIUnstrip.EndHorizontal();
|
||||||
|
|
||||||
bool b = m_localContext;
|
bool b = m_localContext;
|
||||||
b = GUILayout.Toggle(b, "<color=" + (b ? "lime" : "red") + ">Use local transform values?</color>", null);
|
b = GUIUnstrip.Toggle(b, "<color=" + (b ? "lime" : "red") + ">Use local transform values?</color>");
|
||||||
if (b != m_localContext)
|
if (b != m_localContext)
|
||||||
{
|
{
|
||||||
m_localContext = b;
|
m_localContext = b;
|
||||||
@ -583,7 +584,7 @@ namespace Explorer
|
|||||||
|
|
||||||
GUIUnstrip.EndVertical();
|
GUIUnstrip.EndVertical();
|
||||||
|
|
||||||
if (GUILayout.Button("<color=red><b>Destroy</b></color>", new GUILayoutOption[] { GUILayout.Width(120) }))
|
if (GUIUnstrip.Button("<color=red><b>Destroy</b></color>", new GUILayoutOption[] { GUILayout.Width(120) }))
|
||||||
{
|
{
|
||||||
GameObject.Destroy(TargetGO);
|
GameObject.Destroy(TargetGO);
|
||||||
DestroyWindow();
|
DestroyWindow();
|
||||||
@ -614,7 +615,7 @@ namespace Explorer
|
|||||||
lbl += value ? "lime" : "red";
|
lbl += value ? "lime" : "red";
|
||||||
lbl += $">{message}</color>";
|
lbl += $">{message}</color>";
|
||||||
|
|
||||||
value = GUILayout.Toggle(value, lbl, null);
|
value = GUIUnstrip.Toggle(value, lbl);
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum TranslateType
|
public enum TranslateType
|
||||||
@ -627,7 +628,7 @@ namespace Explorer
|
|||||||
private Vector3 TranslateControl(TranslateType mode, ref float amount, bool multByTime)
|
private Vector3 TranslateControl(TranslateType mode, ref float amount, bool multByTime)
|
||||||
{
|
{
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
GUILayout.Label($"<color=cyan><b>{(m_localContext ? "Local " : "")}{mode}</b></color>:",
|
GUIUnstrip.Label($"<color=cyan><b>{(m_localContext ? "Local " : "")}{mode}</b></color>:",
|
||||||
new GUILayoutOption[] { GUILayout.Width(m_localContext ? 110 : 65) });
|
new GUILayoutOption[] { GUILayout.Width(m_localContext ? 110 : 65) });
|
||||||
|
|
||||||
var transform = TargetGO.transform;
|
var transform = TargetGO.transform;
|
||||||
@ -635,14 +636,14 @@ namespace Explorer
|
|||||||
{
|
{
|
||||||
case TranslateType.Position:
|
case TranslateType.Position:
|
||||||
var pos = m_localContext ? transform.localPosition : transform.position;
|
var pos = m_localContext ? transform.localPosition : transform.position;
|
||||||
GUILayout.Label(pos.ToString(), new GUILayoutOption[] { GUILayout.Width(250) });
|
GUIUnstrip.Label(pos.ToString(), new GUILayoutOption[] { GUILayout.Width(250) });
|
||||||
break;
|
break;
|
||||||
case TranslateType.Rotation:
|
case TranslateType.Rotation:
|
||||||
var rot = m_localContext ? transform.localEulerAngles : transform.eulerAngles;
|
var rot = m_localContext ? transform.localEulerAngles : transform.eulerAngles;
|
||||||
GUILayout.Label(rot.ToString(), new GUILayoutOption[] { GUILayout.Width(250) });
|
GUIUnstrip.Label(rot.ToString(), new GUILayoutOption[] { GUILayout.Width(250) });
|
||||||
break;
|
break;
|
||||||
case TranslateType.Scale:
|
case TranslateType.Scale:
|
||||||
GUILayout.Label(transform.localScale.ToString(), new GUILayoutOption[] { GUILayout.Width(250) });
|
GUIUnstrip.Label(transform.localScale.ToString(), new GUILayoutOption[] { GUILayout.Width(250) });
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
GUIUnstrip.EndHorizontal();
|
GUIUnstrip.EndHorizontal();
|
||||||
@ -652,18 +653,18 @@ namespace Explorer
|
|||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
GUI.skin.label.alignment = TextAnchor.MiddleRight;
|
GUI.skin.label.alignment = TextAnchor.MiddleRight;
|
||||||
|
|
||||||
GUILayout.Label("<color=cyan>X:</color>", new GUILayoutOption[] { GUILayout.Width(20) });
|
GUIUnstrip.Label("<color=cyan>X:</color>", new GUILayoutOption[] { GUILayout.Width(20) });
|
||||||
PlusMinusFloat(ref input.x, amount, multByTime);
|
PlusMinusFloat(ref input.x, amount, multByTime);
|
||||||
|
|
||||||
GUILayout.Label("<color=cyan>Y:</color>", new GUILayoutOption[] { GUILayout.Width(20) });
|
GUIUnstrip.Label("<color=cyan>Y:</color>", new GUILayoutOption[] { GUILayout.Width(20) });
|
||||||
PlusMinusFloat(ref input.y, amount, multByTime);
|
PlusMinusFloat(ref input.y, amount, multByTime);
|
||||||
|
|
||||||
GUILayout.Label("<color=cyan>Z:</color>", new GUILayoutOption[] { GUILayout.Width(20) });
|
GUIUnstrip.Label("<color=cyan>Z:</color>", new GUILayoutOption[] { GUILayout.Width(20) });
|
||||||
PlusMinusFloat(ref input.z, amount, multByTime);
|
PlusMinusFloat(ref input.z, amount, multByTime);
|
||||||
|
|
||||||
GUILayout.Label("+/-:", new GUILayoutOption[] { GUILayout.Width(30) });
|
GUIUnstrip.Label("+/-:", new GUILayoutOption[] { GUILayout.Width(30) });
|
||||||
var amountInput = amount.ToString("F3");
|
var amountInput = amount.ToString("F3");
|
||||||
amountInput = GUILayout.TextField(amountInput, new GUILayoutOption[] { GUILayout.Width(60) });
|
amountInput = GUIUnstrip.TextField(amountInput, new GUILayoutOption[] { GUILayout.Width(60) });
|
||||||
if (float.TryParse(amountInput, out float f))
|
if (float.TryParse(amountInput, out float f))
|
||||||
{
|
{
|
||||||
amount = f;
|
amount = f;
|
||||||
@ -678,16 +679,16 @@ namespace Explorer
|
|||||||
private void PlusMinusFloat(ref float f, float amount, bool multByTime)
|
private void PlusMinusFloat(ref float f, float amount, bool multByTime)
|
||||||
{
|
{
|
||||||
string s = f.ToString("F3");
|
string s = f.ToString("F3");
|
||||||
s = GUILayout.TextField(s, new GUILayoutOption[] { GUILayout.Width(60) });
|
s = GUIUnstrip.TextField(s, new GUILayoutOption[] { GUILayout.Width(60) });
|
||||||
if (float.TryParse(s, out float f2))
|
if (float.TryParse(s, out float f2))
|
||||||
{
|
{
|
||||||
f = f2;
|
f = f2;
|
||||||
}
|
}
|
||||||
if (GUILayout.RepeatButton("-", new GUILayoutOption[] { GUILayout.Width(20) }))
|
if (GUIUnstrip.RepeatButton("-", new GUILayoutOption[] { GUILayout.Width(20) }))
|
||||||
{
|
{
|
||||||
f -= multByTime ? amount * Time.deltaTime : amount;
|
f -= multByTime ? amount * Time.deltaTime : amount;
|
||||||
}
|
}
|
||||||
if (GUILayout.RepeatButton("+", new GUILayoutOption[] { GUILayout.Width(20) }))
|
if (GUIUnstrip.RepeatButton("+", new GUILayoutOption[] { GUILayout.Width(20) }))
|
||||||
{
|
{
|
||||||
f += multByTime ? amount * Time.deltaTime : amount;
|
f += multByTime ? amount * Time.deltaTime : amount;
|
||||||
}
|
}
|
||||||
|
@ -236,26 +236,26 @@ namespace Explorer
|
|||||||
}
|
}
|
||||||
|
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
GUILayout.Label("<b>Type:</b> <color=cyan>" + TargetType.FullName + "</color>", new GUILayoutOption[] { GUILayout.Width(245f) });
|
GUIUnstrip.Label("<b>Type:</b> <color=cyan>" + TargetType.FullName + "</color>", new GUILayoutOption[] { GUILayout.Width(245f) });
|
||||||
if (m_uObj)
|
if (m_uObj)
|
||||||
{
|
{
|
||||||
GUILayout.Label("Name: " + m_uObj.name, null);
|
GUIUnstrip.Label("Name: " + m_uObj.name);
|
||||||
}
|
}
|
||||||
GUIUnstrip.EndHorizontal();
|
GUIUnstrip.EndHorizontal();
|
||||||
|
|
||||||
if (m_uObj)
|
if (m_uObj)
|
||||||
{
|
{
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
GUILayout.Label("<b>Tools:</b>", new GUILayoutOption[] { GUILayout.Width(80) });
|
GUIUnstrip.Label("<b>Tools:</b>", new GUILayoutOption[] { GUILayout.Width(80) });
|
||||||
UIHelpers.InstantiateButton(m_uObj);
|
UIHelpers.InstantiateButton(m_uObj);
|
||||||
if (m_component && m_component.gameObject is GameObject obj)
|
if (m_component && m_component.gameObject is GameObject obj)
|
||||||
{
|
{
|
||||||
GUI.skin.label.alignment = TextAnchor.MiddleRight;
|
GUI.skin.label.alignment = TextAnchor.MiddleRight;
|
||||||
GUILayout.Label("GameObject:", new GUILayoutOption[] { GUILayout.Width(135) });
|
GUIUnstrip.Label("GameObject:", new GUILayoutOption[] { GUILayout.Width(135) });
|
||||||
var charWidth = obj.name.Length * 15;
|
var charWidth = obj.name.Length * 15;
|
||||||
var maxWidth = rect.width - 350;
|
var maxWidth = rect.width - 350;
|
||||||
var labelWidth = charWidth < maxWidth ? charWidth : maxWidth;
|
var labelWidth = charWidth < maxWidth ? charWidth : maxWidth;
|
||||||
if (GUILayout.Button("<color=#00FF00>" + obj.name + "</color>", new GUILayoutOption[] { GUILayout.Width(labelWidth) }))
|
if (GUIUnstrip.Button("<color=#00FF00>" + obj.name + "</color>", new GUILayoutOption[] { GUILayout.Width(labelWidth) }))
|
||||||
{
|
{
|
||||||
WindowManager.InspectObject(obj, out bool _);
|
WindowManager.InspectObject(obj, out bool _);
|
||||||
}
|
}
|
||||||
@ -267,12 +267,12 @@ namespace Explorer
|
|||||||
UIStyles.HorizontalLine(Color.grey);
|
UIStyles.HorizontalLine(Color.grey);
|
||||||
|
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
GUILayout.Label("<b>Search:</b>", new GUILayoutOption[] { GUILayout.Width(75) });
|
GUIUnstrip.Label("<b>Search:</b>", new GUILayoutOption[] { GUILayout.Width(75) });
|
||||||
m_search = GUILayout.TextField(m_search, null);
|
m_search = GUIUnstrip.TextField(m_search);
|
||||||
GUIUnstrip.EndHorizontal();
|
GUIUnstrip.EndHorizontal();
|
||||||
|
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
GUILayout.Label("<b>Filter:</b>", new GUILayoutOption[] { GUILayout.Width(75) });
|
GUIUnstrip.Label("<b>Filter:</b>", new GUILayoutOption[] { GUILayout.Width(75) });
|
||||||
FilterToggle(MemberTypes.All, "All");
|
FilterToggle(MemberTypes.All, "All");
|
||||||
FilterToggle(MemberTypes.Property, "Properties");
|
FilterToggle(MemberTypes.Property, "Properties");
|
||||||
FilterToggle(MemberTypes.Field, "Fields");
|
FilterToggle(MemberTypes.Field, "Fields");
|
||||||
@ -280,15 +280,15 @@ namespace Explorer
|
|||||||
GUIUnstrip.EndHorizontal();
|
GUIUnstrip.EndHorizontal();
|
||||||
|
|
||||||
GUIUnstrip.BeginHorizontal();
|
GUIUnstrip.BeginHorizontal();
|
||||||
GUILayout.Label("<b>Values:</b>", new GUILayoutOption[] { GUILayout.Width(75) });
|
GUIUnstrip.Label("<b>Values:</b>", new GUILayoutOption[] { GUILayout.Width(75) });
|
||||||
if (GUILayout.Button("Update", new GUILayoutOption[] { GUILayout.Width(100) }))
|
if (GUIUnstrip.Button("Update", new GUILayoutOption[] { GUILayout.Width(100) }))
|
||||||
{
|
{
|
||||||
UpdateValues();
|
UpdateValues();
|
||||||
}
|
}
|
||||||
GUI.color = m_autoUpdate ? Color.green : Color.red;
|
GUI.color = m_autoUpdate ? Color.green : Color.red;
|
||||||
m_autoUpdate = GUILayout.Toggle(m_autoUpdate, "Auto-update?", new GUILayoutOption[] { GUILayout.Width(100) });
|
m_autoUpdate = GUIUnstrip.Toggle(m_autoUpdate, "Auto-update?", new GUILayoutOption[] { GUILayout.Width(100) });
|
||||||
GUI.color = m_hideFailedReflection ? Color.green : Color.red;
|
GUI.color = m_hideFailedReflection ? Color.green : Color.red;
|
||||||
m_hideFailedReflection = GUILayout.Toggle(m_hideFailedReflection, "Hide failed Reflection?", new GUILayoutOption[] { GUILayout.Width(150) });
|
m_hideFailedReflection = GUIUnstrip.Toggle(m_hideFailedReflection, "Hide failed Reflection?", new GUILayoutOption[] { GUILayout.Width(150) });
|
||||||
GUI.color = Color.white;
|
GUI.color = Color.white;
|
||||||
GUIUnstrip.EndHorizontal();
|
GUIUnstrip.EndHorizontal();
|
||||||
|
|
||||||
@ -303,14 +303,14 @@ namespace Explorer
|
|||||||
|
|
||||||
if (Pages.ItemCount > Pages.ItemsPerPage)
|
if (Pages.ItemCount > Pages.ItemsPerPage)
|
||||||
{
|
{
|
||||||
if (GUILayout.Button("< Prev", new GUILayoutOption[] { GUILayout.Width(80) }))
|
if (GUIUnstrip.Button("< Prev", new GUILayoutOption[] { GUILayout.Width(80) }))
|
||||||
{
|
{
|
||||||
Pages.TurnPage(Turn.Left, ref this.scroll);
|
Pages.TurnPage(Turn.Left, ref this.scroll);
|
||||||
}
|
}
|
||||||
|
|
||||||
Pages.CurrentPageLabel();
|
Pages.CurrentPageLabel();
|
||||||
|
|
||||||
if (GUILayout.Button("Next >", new GUILayoutOption[] { GUILayout.Width(80) }))
|
if (GUIUnstrip.Button("Next >", new GUILayoutOption[] { GUILayout.Width(80) }))
|
||||||
{
|
{
|
||||||
Pages.TurnPage(Turn.Right, ref this.scroll);
|
Pages.TurnPage(Turn.Right, ref this.scroll);
|
||||||
}
|
}
|
||||||
@ -386,7 +386,7 @@ namespace Explorer
|
|||||||
{
|
{
|
||||||
GUI.color = Color.white;
|
GUI.color = Color.white;
|
||||||
}
|
}
|
||||||
if (GUILayout.Button(label, new GUILayoutOption[] { GUILayout.Width(100) }))
|
if (GUIUnstrip.Button(label, new GUILayoutOption[] { GUILayout.Width(100) }))
|
||||||
{
|
{
|
||||||
m_filter = mode;
|
m_filter = mode;
|
||||||
Pages.PageOffset = 0;
|
Pages.PageOffset = 0;
|
||||||
|
@ -29,14 +29,14 @@ namespace Explorer
|
|||||||
GUIUnstrip.BeginHorizontal(GUI.skin.box, null);
|
GUIUnstrip.BeginHorizontal(GUI.skin.box, null);
|
||||||
|
|
||||||
GUI.skin.label.alignment = TextAnchor.MiddleCenter;
|
GUI.skin.label.alignment = TextAnchor.MiddleCenter;
|
||||||
GUILayout.Button(gcDrag, GUI.skin.label, new GUILayoutOption[] { GUILayout.Height(15) });
|
GUIUnstrip.Button(gcDrag, GUI.skin.label, new GUILayoutOption[] { GUILayout.Height(15) });
|
||||||
|
|
||||||
//var r = GUILayoutUtility.GetLastRect();
|
//var r = GUILayoutUtility.GetLastRect();
|
||||||
var r = LayoutUtilityUnstrip.GetLastRect();
|
var r = LayoutUtilityUnstrip.GetLastRect();
|
||||||
|
|
||||||
var mousePos = InputHelper.mousePosition;
|
var mousePos = InputHelper.mousePosition;
|
||||||
|
|
||||||
Vector2 mouse = GUIUtility.ScreenToGUIPoint(new Vector2(mousePos.x, Screen.height - mousePos.y));
|
var mouse = GUIUnstrip.ScreenToGUIPoint(new Vector2(mousePos.x, Screen.height - mousePos.y));
|
||||||
|
|
||||||
if (r.Contains(mouse) && InputHelper.GetMouseButtonDown(0))
|
if (r.Contains(mouse) && InputHelper.GetMouseButtonDown(0))
|
||||||
{
|
{
|
||||||
@ -78,24 +78,24 @@ namespace Explorer
|
|||||||
{
|
{
|
||||||
GUIUnstrip.BeginHorizontal(GUI.skin.box, null);
|
GUIUnstrip.BeginHorizontal(GUI.skin.box, null);
|
||||||
|
|
||||||
GUILayout.Label("Resize window:", new GUILayoutOption[] { GUILayout.Width(100) });
|
GUIUnstrip.Label("Resize window:", new GUILayoutOption[] { GUILayout.Width(100) });
|
||||||
|
|
||||||
GUI.skin.label.alignment = TextAnchor.MiddleRight;
|
GUI.skin.label.alignment = TextAnchor.MiddleRight;
|
||||||
GUILayout.Label("<color=cyan>Width:</color>", new GUILayoutOption[] { GUILayout.Width(60) });
|
GUIUnstrip.Label("<color=cyan>Width:</color>", new GUILayoutOption[] { GUILayout.Width(60) });
|
||||||
if (GUILayout.RepeatButton("-", new GUILayoutOption[] { GUILayout.Width(20) }))
|
if (GUIUnstrip.RepeatButton("-", new GUILayoutOption[] { GUILayout.Width(20) }))
|
||||||
{
|
{
|
||||||
_rect.width -= 5f;
|
_rect.width -= 5f;
|
||||||
}
|
}
|
||||||
if (GUILayout.RepeatButton("+", new GUILayoutOption[] { GUILayout.Width(20) }))
|
if (GUIUnstrip.RepeatButton("+", new GUILayoutOption[] { GUILayout.Width(20) }))
|
||||||
{
|
{
|
||||||
_rect.width += 5f;
|
_rect.width += 5f;
|
||||||
}
|
}
|
||||||
GUILayout.Label("<color=cyan>Height:</color>", new GUILayoutOption[] { GUILayout.Width(60) });
|
GUIUnstrip.Label("<color=cyan>Height:</color>", new GUILayoutOption[] { GUILayout.Width(60) });
|
||||||
if (GUILayout.RepeatButton("-", new GUILayoutOption[] { GUILayout.Width(20) }))
|
if (GUIUnstrip.RepeatButton("-", new GUILayoutOption[] { GUILayout.Width(20) }))
|
||||||
{
|
{
|
||||||
_rect.height -= 5f;
|
_rect.height -= 5f;
|
||||||
}
|
}
|
||||||
if (GUILayout.RepeatButton("+", new GUILayoutOption[] { GUILayout.Width(20) }))
|
if (GUIUnstrip.RepeatButton("+", new GUILayoutOption[] { GUILayout.Width(20) }))
|
||||||
{
|
{
|
||||||
_rect.height += 5f;
|
_rect.height += 5f;
|
||||||
}
|
}
|
||||||
|
@ -87,11 +87,11 @@ namespace Explorer
|
|||||||
GUI.color = focused ? Color.green : Color.white;
|
GUI.color = focused ? Color.green : Color.white;
|
||||||
|
|
||||||
var window = WindowManager.Windows[i];
|
var window = WindowManager.Windows[i];
|
||||||
if (GUILayout.Button(color + window.Title + "</color>", new GUILayoutOption[] { GUILayout.Width(200) }))
|
if (GUIUnstrip.Button(color + window.Title + "</color>", new GUILayoutOption[] { GUILayout.Width(200) }))
|
||||||
{
|
{
|
||||||
TargetTabID = i;
|
TargetTabID = i;
|
||||||
}
|
}
|
||||||
if (GUILayout.Button("<color=red><b>X</b></color>", new GUILayoutOption[] { GUILayout.Width(22) }))
|
if (GUIUnstrip.Button("<color=red><b>X</b></color>", new GUILayoutOption[] { GUILayout.Width(22) }))
|
||||||
{
|
{
|
||||||
window.DestroyWindow();
|
window.DestroyWindow();
|
||||||
}
|
}
|
||||||
|
@ -52,6 +52,19 @@ namespace Explorer
|
|||||||
return m_scrollStack;
|
return m_scrollStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ======== Fix for GUIUtility.ScreenToGuiPoint ========
|
||||||
|
|
||||||
|
public static Vector2 ScreenToGUIPoint(Vector2 screenPoint)
|
||||||
|
{
|
||||||
|
return GUIClip.ClipToWindow(InternalScreenToWindowPoint(screenPoint));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Vector2 InternalScreenToWindowPoint(Vector2 screenPoint)
|
||||||
|
{
|
||||||
|
GUIUtility.InternalScreenToWindowPoint_Injected(ref screenPoint, out Vector2 result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
// ================= Fix for Space =================
|
// ================= Fix for Space =================
|
||||||
|
|
||||||
public static void Space(float pixels)
|
public static void Space(float pixels)
|
||||||
@ -220,7 +233,7 @@ namespace Explorer
|
|||||||
// Make a repeating button. The button returns true as long as the user holds down the mouse
|
// Make a repeating button. The button returns true as long as the user holds down the mouse
|
||||||
static public bool RepeatButton(GUIContent content, GUIStyle style, params GUILayoutOption[] options) { return DoRepeatButton(content, style, options); }
|
static public bool RepeatButton(GUIContent content, GUIStyle style, params GUILayoutOption[] options) { return DoRepeatButton(content, style, options); }
|
||||||
static bool DoRepeatButton(GUIContent content, GUIStyle style, GUILayoutOption[] options)
|
static bool DoRepeatButton(GUIContent content, GUIStyle style, GUILayoutOption[] options)
|
||||||
{ return GUI.RepeatButton(LayoutUtilityUnstrip.GetRect(content, style, options), content, style); }
|
{ return RepeatButton(LayoutUtilityUnstrip.GetRect(content, style, options), content, style); }
|
||||||
|
|
||||||
public static string TextField(string text, params GUILayoutOption[] options) { return DoTextField(text, -1, false, GUI.skin.textField, options); }
|
public static string TextField(string text, params GUILayoutOption[] options) { return DoTextField(text, -1, false, GUI.skin.textField, options); }
|
||||||
public static string TextField(string text, int maxLength, params GUILayoutOption[] options) { return DoTextField(text, maxLength, false, GUI.skin.textField, options); }
|
public static string TextField(string text, int maxLength, params GUILayoutOption[] options) { return DoTextField(text, maxLength, false, GUI.skin.textField, options); }
|
||||||
@ -262,6 +275,72 @@ namespace Explorer
|
|||||||
static bool DoToggle(bool value, GUIContent content, GUIStyle style, GUILayoutOption[] options)
|
static bool DoToggle(bool value, GUIContent content, GUIStyle style, GUILayoutOption[] options)
|
||||||
{ return GUI.Toggle(LayoutUtilityUnstrip.GetRect(content, style, options), value, content, style); }
|
{ return GUI.Toggle(LayoutUtilityUnstrip.GetRect(content, style, options), value, content, style); }
|
||||||
|
|
||||||
|
// =========== Fix for GUI.RepeatButton (not GUILayout) ===========
|
||||||
|
|
||||||
|
public static bool RepeatButton(Rect position, string text)
|
||||||
|
{
|
||||||
|
return DoRepeatButton(position, GUIContent.Temp(text), GUI.s_Skin.button, FocusType.Passive);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool RepeatButton(Rect position, Texture image)
|
||||||
|
{
|
||||||
|
return DoRepeatButton(position, GUIContent.Temp(image), GUI.s_Skin.button, FocusType.Passive);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool RepeatButton(Rect position, GUIContent content)
|
||||||
|
{
|
||||||
|
return DoRepeatButton(position, content, GUI.s_Skin.button, FocusType.Passive);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool RepeatButton(Rect position, string text, GUIStyle style)
|
||||||
|
{
|
||||||
|
return DoRepeatButton(position, GUIContent.Temp(text), style, FocusType.Passive);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool RepeatButton(Rect position, Texture image, GUIStyle style)
|
||||||
|
{
|
||||||
|
return DoRepeatButton(position, GUIContent.Temp(image), style, FocusType.Passive);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool RepeatButton(Rect position, GUIContent content, GUIStyle style)
|
||||||
|
{
|
||||||
|
return DoRepeatButton(position, content, style, FocusType.Passive);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool DoRepeatButton(Rect position, GUIContent content, GUIStyle style, FocusType focusType)
|
||||||
|
{
|
||||||
|
int id = GUIUtility.GetControlID(GUI.s_RepeatButtonHash, focusType, position);
|
||||||
|
switch (Event.current.GetTypeForControl(id))
|
||||||
|
{
|
||||||
|
case EventType.MouseDown:
|
||||||
|
// If the mouse is inside the button, we say that we're the hot control
|
||||||
|
if (position.Contains(Event.current.mousePosition))
|
||||||
|
{
|
||||||
|
GUIUtility.hotControl = id;
|
||||||
|
Event.current.Use();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
case EventType.MouseUp:
|
||||||
|
if (GUIUtility.hotControl == id)
|
||||||
|
{
|
||||||
|
GUIUtility.hotControl = 0;
|
||||||
|
|
||||||
|
// If we got the mousedown, the mouseup is ours as well
|
||||||
|
// (no matter if the click was in the button or not)
|
||||||
|
Event.current.Use();
|
||||||
|
|
||||||
|
// But we only return true if the button was actually clicked
|
||||||
|
return position.Contains(Event.current.mousePosition);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
case EventType.Repaint:
|
||||||
|
style.Draw(position, content, id, false, position.Contains(Event.current.mousePosition));
|
||||||
|
return id == GUIUtility.hotControl && position.Contains(Event.current.mousePosition);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ================= Fix for BeginScrollView. =======================
|
// ================= Fix for BeginScrollView. =======================
|
||||||
|
|
||||||
public static Vector2 BeginScrollView(Vector2 scroll, params GUILayoutOption[] options)
|
public static Vector2 BeginScrollView(Vector2 scroll, params GUILayoutOption[] options)
|
||||||
@ -271,7 +350,7 @@ namespace Explorer
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return GUILayout.BeginScrollView(scroll, options);
|
return GUIUnstrip.BeginScrollView(scroll, options);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
@ -303,7 +382,7 @@ namespace Explorer
|
|||||||
|
|
||||||
if (!ScrollFailed)
|
if (!ScrollFailed)
|
||||||
{
|
{
|
||||||
GUILayout.EndScrollView();
|
GUIUnstrip.EndScrollView();
|
||||||
}
|
}
|
||||||
else if (!ManualUnstripFailed)
|
else if (!ManualUnstripFailed)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user