ComponentList 완료, Context 메뉴 추가

This commit is contained in:
김형인
2025-08-09 01:39:24 +09:00
parent 165c3a709f
commit bf10b6f94a
22 changed files with 1428 additions and 42 deletions

View File

@@ -0,0 +1,46 @@
#nullable enable
using System;
using UVC.UI.Commands;
namespace UVC.UI.Menu
{
/// <summary>
/// 컨텍스트 메뉴의 각 항목에 대한 정보를 담는 데이터 구조체입니다.
/// 인스펙터에서 메뉴 항목을 쉽게 설정할 수 있도록 Serializable 특성을 가집니다.
/// </summary>
[Serializable]
public class ContextMenuItemData
{
/// <summary>
/// 메뉴 아이템의 고유 식별자입니다.
/// </summary>
public string ItemId { get; private set; }
/// <summary>
/// UI에 표시될 메뉴 아이템의 이름입니다. 다국어 키도 가능합니다.
/// 이 키를 사용하여 실제 표시될 텍스트를 가져옵니다.
/// </summary>
public string DisplayName { get; private set; }
/// <summary>
/// 메뉴 아이템이 선택되었을 때 실행될 명령입니다.
/// `ICommand` 인터페이스를 구현하는 객체여야 합니다.
/// 실행할 동작이 없는 경우 null일 수 있습니다.
/// </summary>
public ICommand Command { get; private set; }
/// <summary>
/// <see cref="Command"/> 실행 시 전달될 파라미터입니다.
/// 이 파라미터는 <see cref="ICommand.Execute"/> 호출 시 사용됩니다.
/// </summary>
public object? CommandParameter { get; set; }
public ContextMenuItemData(string ItemId, string DisplayName, ICommand Command, string CommandParameter = null)
{
this.ItemId = ItemId;
this.DisplayName = DisplayName;
this.Command = Command;
this.CommandParameter = CommandParameter;
}
}
}