자산 목록창 내 아이템 드래그에도 자산 아이템 선택이 변경되도록 수정 #16
@@ -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
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -35,6 +35,9 @@ namespace XED.Hierarchy
|
||||
|
||||
public UnityEvent<List<HierarchyItem>> onSelect;
|
||||
public UnityEvent<HierarchyItem, HierarchyItem> onParentChanged;
|
||||
|
||||
public bool isSiblingEditable;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
content = UtilityFunction.FindDeepChild(transform, "Content").GetComponent<RectTransform>();
|
||||
@@ -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))
|
||||
{
|
||||
|
||||
@@ -33,6 +33,7 @@ namespace XED.Hierarchy
|
||||
public GameObject highLight;
|
||||
public List<HierarchyItemSprite> itemSprites;
|
||||
private Image backgroundImage;
|
||||
public bool isSelected;
|
||||
private void Awake()
|
||||
{
|
||||
backgroundImage = GetComponent<Image>();
|
||||
@@ -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<HierarchyItem> selectedItems)
|
||||
{
|
||||
if (selectedItems.Contains(currentItem))
|
||||
isSelected = selectedItems.Contains(currentItem);
|
||||
if (isSelected)
|
||||
{
|
||||
backgroundImage.color = selectedColor;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user