From 49ce9f7ece911b7b8e52213a4268b96c3fa7495d Mon Sep 17 00:00:00 2001 From: geondo55 <102933884+geondo55@users.noreply.github.com> Date: Tue, 18 Mar 2025 15:12:59 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=EC=9E=90=EC=82=B0=20=EB=AA=A9=EB=A1=9D?= =?UTF-8?q?=EC=B0=BD=20=EB=82=B4=20=EC=95=84=EC=9D=B4=ED=85=9C=20=EB=93=9C?= =?UTF-8?q?=EB=9E=98=EA=B7=B8=EC=97=90=EB=8F=84=20=EC=9E=90=EC=82=B0=20?= =?UTF-8?q?=EC=95=84=EC=9D=B4=ED=85=9C=20=EC=84=A0=ED=83=9D=EC=9D=B4=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=EB=90=98=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Studio/UI/TreeView/CustomScrollRect.cs | 5 +++++ Assets/Scripts/Studio/UI/TreeView/ScrollItemUI.cs | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/Studio/UI/TreeView/CustomScrollRect.cs b/Assets/Scripts/Studio/UI/TreeView/CustomScrollRect.cs index e62d0f9f..316469ba 100644 --- a/Assets/Scripts/Studio/UI/TreeView/CustomScrollRect.cs +++ b/Assets/Scripts/Studio/UI/TreeView/CustomScrollRect.cs @@ -24,6 +24,11 @@ namespace XED.Hierarchy private Coroutine coroutinePendPopup; public override void OnBeginDrag(PointerEventData eventData) { + ScrollItemUI itemUI = GetTargetItemUI(eventData); + if (itemUI != null && !itemUI.isSelected) + { + itemUI.OnPointerClick(eventData); + } onDragBegin?.Invoke(sourceItem); if (!passDragToChildren) { diff --git a/Assets/Scripts/Studio/UI/TreeView/ScrollItemUI.cs b/Assets/Scripts/Studio/UI/TreeView/ScrollItemUI.cs index 6a8c9870..9f71ea95 100644 --- a/Assets/Scripts/Studio/UI/TreeView/ScrollItemUI.cs +++ b/Assets/Scripts/Studio/UI/TreeView/ScrollItemUI.cs @@ -33,6 +33,7 @@ namespace XED.Hierarchy public GameObject highLight; public List itemSprites; private Image backgroundImage; + public bool isSelected; private void Awake() { backgroundImage = GetComponent(); @@ -69,7 +70,8 @@ namespace XED.Hierarchy } public void SetSelected(bool selected) { - if (selected) + isSelected = selected; + if (isSelected) { backgroundImage.color = selectedColor; } @@ -80,7 +82,8 @@ namespace XED.Hierarchy } public void SetSelected(List selectedItems) { - if (selectedItems.Contains(currentItem)) + isSelected = selectedItems.Contains(currentItem); + if (isSelected) { backgroundImage.color = selectedColor; } -- 2.48.1.windows.1 From 8c9e46de4ba58dc81bed1e93ed6c9246c7d3db17 Mon Sep 17 00:00:00 2001 From: geondo55 <102933884+geondo55@users.noreply.github.com> Date: Tue, 18 Mar 2025 16:18:40 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=ED=95=98=EC=9D=B4=EC=96=B4=EB=9D=BC?= =?UTF-8?q?=ED=82=A4=20=ED=8A=B8=EB=A6=AC=20UI=EC=97=90=20=EB=93=9C?= =?UTF-8?q?=EB=9E=98=EA=B7=B8=20=EB=93=9C=EB=9E=8D=20=EA=B6=8C=ED=95=9C=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Prefabs/UI/Hierarchy.prefab | 10 +++++++++- Assets/Scripts/Studio/UI/TreeView/PooledScrollView.cs | 9 ++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Assets/Prefabs/UI/Hierarchy.prefab b/Assets/Prefabs/UI/Hierarchy.prefab index 671a3171..9a679d73 100644 --- a/Assets/Prefabs/UI/Hierarchy.prefab +++ b/Assets/Prefabs/UI/Hierarchy.prefab @@ -612,6 +612,14 @@ PrefabInstance: propertyPath: m_Size value: 1 objectReference: {fileID: 0} + - target: {fileID: 3692082455671801088, guid: c7fa5154df436e54bb0b444dfc25575d, type: 3} + propertyPath: isDraggable + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3692082455671801088, guid: c7fa5154df436e54bb0b444dfc25575d, type: 3} + propertyPath: isSiblingEditable + value: 1 + objectReference: {fileID: 0} - target: {fileID: 3853414527505018043, guid: c7fa5154df436e54bb0b444dfc25575d, type: 3} propertyPath: m_AnchorMax.x value: 1 @@ -658,7 +666,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4494893725557815844, guid: c7fa5154df436e54bb0b444dfc25575d, type: 3} propertyPath: m_Value - value: 1 + value: 1.0000204 objectReference: {fileID: 0} - target: {fileID: 5185907358101567880, guid: c7fa5154df436e54bb0b444dfc25575d, type: 3} propertyPath: m_Maskable diff --git a/Assets/Scripts/Studio/UI/TreeView/PooledScrollView.cs b/Assets/Scripts/Studio/UI/TreeView/PooledScrollView.cs index 77a502a0..a16df68d 100644 --- a/Assets/Scripts/Studio/UI/TreeView/PooledScrollView.cs +++ b/Assets/Scripts/Studio/UI/TreeView/PooledScrollView.cs @@ -35,6 +35,9 @@ namespace XED.Hierarchy public UnityEvent> onSelect; public UnityEvent onParentChanged; + + public bool isSiblingEditable; + private void Awake() { content = UtilityFunction.FindDeepChild(transform, "Content").GetComponent(); @@ -331,7 +334,7 @@ namespace XED.Hierarchy } public void SetToChildItem(HierarchyItem srcItem, HierarchyItem destItem) { - if (srcItem == null || destItem == null) + if (srcItem == null || destItem == null || !isSiblingEditable) return; if (selectedItems.Contains(srcItem)) { @@ -384,7 +387,7 @@ namespace XED.Hierarchy } public void SetToNextSiblingItem(HierarchyItem srcItem, HierarchyItem destItem) { - if (srcItem == null || destItem == null) + if (srcItem == null || destItem == null || !isSiblingEditable) return; if (selectedItems.Contains(srcItem)) { @@ -437,7 +440,7 @@ namespace XED.Hierarchy } public void SetToPriorSiblingItem(HierarchyItem srcItem, HierarchyItem destItem) { - if (srcItem == null || destItem == null) + if (srcItem == null || destItem == null || !isSiblingEditable) return; if (selectedItems.Contains(srcItem)) { -- 2.48.1.windows.1