48 lines
1.5 KiB
C#
48 lines
1.5 KiB
C#
#nullable enable
|
|
using UnityEngine;
|
|
using UVC.UI.List.Accordion;
|
|
|
|
namespace UVC.UI.Window
|
|
{
|
|
/// <summary>
|
|
/// 아코디언 리스트(<see cref="AccordionList"/>)를 포함하는 간단한 컨테이너 윈도우.
|
|
/// 외부에서 전달된 데이터로 내부 리스트를 구성합니다.
|
|
/// </summary>
|
|
public class AccordionWindow : MonoBehaviour
|
|
{
|
|
[SerializeField]
|
|
private AccordionList list = default!;
|
|
|
|
[Tooltip("드래그 시 그리드 아이템 이미지가 커서를 따라다니도록 설정합니다.")]
|
|
[SerializeField]
|
|
private bool dragImageFollowCursor = true;
|
|
|
|
/// <summary>
|
|
/// 내부 <see cref="AccordionList"/>에 대한 접근자.
|
|
/// 이벤트 구독 등 외부에서 리스트에 직접 접근할 때 사용합니다.
|
|
/// </summary>
|
|
public AccordionList AccordionList => list;
|
|
|
|
private void Awake()
|
|
{
|
|
if (list == null)
|
|
{
|
|
Debug.LogWarning("AccordionWindow: list is not assigned.");
|
|
}
|
|
else
|
|
{
|
|
list.dragImageFollowCursor = dragImageFollowCursor;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 내부 <see cref="AccordionList"/>에 데이터를 설정합니다.
|
|
/// </summary>
|
|
/// <param name="data">아코디언 루트 데이터.</param>
|
|
public void SetData(AccordionData data)
|
|
{
|
|
list!.SetData(data);
|
|
}
|
|
}
|
|
}
|