UTKAccodion 완료. UTKComponentList 수정 중
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#nullable enable
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
@@ -41,6 +42,9 @@ namespace UVC.UIToolkit
|
||||
/// // 아이콘 존재 여부 확인
|
||||
/// if (UTKMaterialIcons.HasIcon("search")) { }
|
||||
///
|
||||
/// // 존재하는 유니코드 문자인지 확인
|
||||
/// if (UTKMaterialIcons.IsIconChar("□")) { }
|
||||
///
|
||||
/// // 전체 아이콘 이름 순회
|
||||
/// foreach (var name in UTKMaterialIcons.GetAllIconNames()) { }
|
||||
///
|
||||
@@ -152,10 +156,10 @@ namespace UVC.UIToolkit
|
||||
/// </summary>
|
||||
/// <param name="element">스타일을 적용할 요소</param>
|
||||
/// <param name="fontSize">폰트 크기 (기본값: 24)</param>
|
||||
public static void ApplyIconStyle(VisualElement element, int fontSize = 24)
|
||||
public static void ApplyIconStyle(VisualElement element, int? fontSize = 24)
|
||||
{
|
||||
element.style.unityFontDefinition = GetFontDefinition();
|
||||
element.style.fontSize = fontSize;
|
||||
if(fontSize != null) element.style.fontSize = fontSize.Value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -12501,6 +12505,7 @@ namespace UVC.UIToolkit
|
||||
/// <returns>아이콘 문자, 없으면 빈 문자열</returns>
|
||||
public static string GetIcon(string iconName)
|
||||
{
|
||||
if(IsIconChar(iconName)) return iconName;
|
||||
return _iconsByName.TryGetValue(iconName, out var icon) ? icon : string.Empty;
|
||||
}
|
||||
|
||||
@@ -12509,6 +12514,11 @@ namespace UVC.UIToolkit
|
||||
/// </summary>
|
||||
public static bool HasIcon(string iconName) => _iconsByName.ContainsKey(iconName);
|
||||
|
||||
/// <summary>
|
||||
/// 유니코드 문자로 아이콘이 존재하는지 확인합니다.
|
||||
/// </summary>
|
||||
public static bool IsIconChar(string iconChar) => _iconsByName.Values.Contains(iconChar);
|
||||
|
||||
/// <summary>
|
||||
/// 모든 아이콘 이름 목록을 반환합니다.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user