mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-06-17 06:28:42 +08:00
Use "untitled" for transforms with empty names
This commit is contained in:
parent
bc64a04339
commit
9f78c50854
@ -16,15 +16,15 @@ namespace UnityExplorer.UI.Widgets
|
|||||||
{
|
{
|
||||||
public float DefaultHeight => 25f;
|
public float DefaultHeight => 25f;
|
||||||
|
|
||||||
public bool Enabled => m_enabled;
|
public bool Enabled => enabled;
|
||||||
private bool m_enabled;
|
private bool enabled;
|
||||||
|
|
||||||
public Action<CachedTransform> OnExpandToggled;
|
public Action<CachedTransform> OnExpandToggled;
|
||||||
public Action<CachedTransform> OnEnableToggled;
|
public Action<CachedTransform> OnEnableToggled;
|
||||||
public Action<GameObject> OnGameObjectClicked;
|
public Action<GameObject> OnGameObjectClicked;
|
||||||
|
|
||||||
public CachedTransform cachedTransform;
|
public CachedTransform cachedTransform;
|
||||||
public int _cellIndex;
|
public int cellIndex;
|
||||||
|
|
||||||
public GameObject UIRoot { get; set; }
|
public GameObject UIRoot { get; set; }
|
||||||
public RectTransform Rect { get; set; }
|
public RectTransform Rect { get; set; }
|
||||||
@ -37,13 +37,13 @@ namespace UnityExplorer.UI.Widgets
|
|||||||
|
|
||||||
public void Enable()
|
public void Enable()
|
||||||
{
|
{
|
||||||
m_enabled = true;
|
enabled = true;
|
||||||
UIRoot.SetActive(true);
|
UIRoot.SetActive(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Disable()
|
public void Disable()
|
||||||
{
|
{
|
||||||
m_enabled = false;
|
enabled = false;
|
||||||
UIRoot.SetActive(false);
|
UIRoot.SetActive(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,14 +58,17 @@ namespace UnityExplorer.UI.Widgets
|
|||||||
if (!Enabled)
|
if (!Enabled)
|
||||||
Enable();
|
Enable();
|
||||||
|
|
||||||
_cellIndex = cellIndex;
|
this.cellIndex = cellIndex;
|
||||||
cachedTransform = cached;
|
cachedTransform = cached;
|
||||||
|
|
||||||
spacer.minWidth = cached.Depth * 15;
|
spacer.minWidth = cached.Depth * 15;
|
||||||
|
|
||||||
if (cached.Value)
|
if (cached.Value)
|
||||||
{
|
{
|
||||||
NameButton.ButtonText.text = cached.Value.name;
|
string name = cached.Value.name?.Trim();
|
||||||
|
if (string.IsNullOrEmpty(name))
|
||||||
|
name = "<i><color=grey>untitled</color></i>";
|
||||||
|
NameButton.ButtonText.text = name;
|
||||||
NameButton.ButtonText.color = cached.Value.gameObject.activeSelf ? Color.white : Color.grey;
|
NameButton.ButtonText.color = cached.Value.gameObject.activeSelf ? Color.white : Color.grey;
|
||||||
|
|
||||||
EnabledToggle.Set(cached.Value.gameObject.activeSelf, false);
|
EnabledToggle.Set(cached.Value.gameObject.activeSelf, false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user