자산 목록창 내 아이템 드래그에도 자산 아이템 선택이 변경되도록 수정 #16
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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