#nullable enable using System.Collections.Generic; using UVC.UI.Commands; namespace UVC.UIToolkit { /// /// 이미지 아이콘을 사용하는 메뉴 아이템 데이터 클래스입니다. /// UTKMenuItemData를 상속받아 이미지 경로 정보를 추가합니다. /// /// /// /// // 이미지 메뉴 아이템 생성 /// var imageItem = new UTKMenuImageItemData( /// "settings", /// "Settings/gear", // 이미지 경로 /// new OpenSettingsCommand() /// ); /// /// // Material Icon 사용 /// var iconItem = new UTKMenuImageItemData( /// "home", /// UTKMaterialIcons.Home, // Material Icon /// new NavigateHomeCommand() /// ); /// /// public class UTKMenuImageItemData : UTKMenuItemData { #region Properties /// /// 이미지 경로 또는 Material Icon 문자 (Unicode). /// Resources 폴더 기준 경로 또는 Material Icon 유니코드 문자열. /// public string ImagePath { get; set; } /// /// Material Icon 사용 여부. /// true면 ImagePath를 Material Icon Unicode로 처리합니다. /// public bool UseMaterialIcon { get; set; } /// /// 이미지 크기 (픽셀). 기본값: 20. /// public float ImageSize { get; set; } = 20f; /// /// 이미지 색상. null이면 기본 색상 사용. /// public UnityEngine.Color? ImageColor { get; set; } #endregion #region Constructor /// /// UTKMenuImageItemData의 새 인스턴스를 초기화합니다. /// /// 메뉴 아이템의 고유 ID /// 이미지 경로 또는 Material Icon /// 실행할 명령 (선택 사항) /// Command 파라미터 (선택 사항) /// 하위 메뉴 아이템 목록 (선택 사항) /// 활성화 상태 (기본값: true) /// 단축키 문자열 (선택 사항) /// Material Icon 사용 여부 (기본값: false) /// 이미지 크기 (기본값: 20) /// 이미지 색상 (선택 사항) public UTKMenuImageItemData( string itemId, string imagePath, ICommand? command = null, object? commandParameter = null, List? subMenuItems = null, bool isEnabled = true, string? shortcut = null, bool useMaterialIcon = false, float imageSize = 20f, UnityEngine.Color? imageColor = null) : base(itemId, imagePath, command, commandParameter, subMenuItems, false, isEnabled, shortcut) { ImagePath = imagePath; UseMaterialIcon = useMaterialIcon; ImageSize = imageSize; ImageColor = imageColor; } #endregion } }