From 2b715f3dbee62129e201bb4ab8b907b71d65b136 Mon Sep 17 00:00:00 2001 From: Sinai <49360850+sinai-dev@users.noreply.github.com> Date: Sat, 12 Mar 2022 20:16:55 +1100 Subject: [PATCH] Hide SiblingIndex input when invalid --- src/UI/Widgets/TransformTree/TransformCell.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/UI/Widgets/TransformTree/TransformCell.cs b/src/UI/Widgets/TransformTree/TransformCell.cs index 41263d6..b944574 100644 --- a/src/UI/Widgets/TransformTree/TransformCell.cs +++ b/src/UI/Widgets/TransformTree/TransformCell.cs @@ -79,8 +79,14 @@ namespace UnityExplorer.UI.Widgets EnabledToggle.Set(cached.Value.gameObject.activeSelf, false); - if (!SiblingIndex.Component.isFocused) - SiblingIndex.Text = cached.Value.GetSiblingIndex().ToString(); + if (!cached.Value.parent) + SiblingIndex.GameObject.SetActive(false); + else + { + SiblingIndex.GameObject.SetActive(true); + if (!SiblingIndex.Component.isFocused) + SiblingIndex.Text = cached.Value.GetSiblingIndex().ToString(); + } int childCount = cached.Value.childCount; if (childCount > 0) @@ -102,6 +108,8 @@ namespace UnityExplorer.UI.Widgets { NameButton.ButtonText.text = $"[Destroyed]"; NameButton.ButtonText.color = Color.red; + + SiblingIndex.GameObject.SetActive(false); } }