스타일 가이드 수정 중

This commit is contained in:
logonkhi
2026-01-23 19:04:12 +09:00
parent 59d473c87b
commit 99f9c3b26d
86 changed files with 3013 additions and 1795 deletions

View File

@@ -545,6 +545,21 @@ namespace UVC.UIToolkit.Editor
sb.AppendLine(" public static IEnumerable<string> GetAllIconNames() => _pathsByName.Keys;");
sb.AppendLine();
sb.AppendLine(" /// <summary>");
sb.AppendLine(" /// 리소스 경로로 아이콘 이름을 조회합니다.");
sb.AppendLine(" /// </summary>");
sb.AppendLine(" /// <param name=\"resourcePath\">리소스 경로 (예: Icons/Home)</param>");
sb.AppendLine(" /// <returns>아이콘 이름, 없으면 빈 문자열</returns>");
sb.AppendLine(" public static string GetIconName(string resourcePath)");
sb.AppendLine(" {");
sb.AppendLine(" foreach (var kvp in _pathsByName)");
sb.AppendLine(" {");
sb.AppendLine(" if (kvp.Value == resourcePath) return kvp.Key;");
sb.AppendLine(" }");
sb.AppendLine(" return string.Empty;");
sb.AppendLine(" }");
sb.AppendLine();
sb.AppendLine(" /// <summary>");
sb.AppendLine(" /// 전체 아이콘 수를 반환합니다.");
sb.AppendLine(" /// </summary>");

View File

@@ -465,8 +465,22 @@ namespace UVC.UIToolkit.Editor
sb.AppendLine(" /// <returns>아이콘 문자, 없으면 빈 문자열</returns>");
sb.AppendLine(" public static string GetIcon(string iconName)");
sb.AppendLine(" {");
sb.AppendLine(" // 실제 유니코드 문자가 아니라 이스케이프 문자열인 경우 변환");
sb.AppendLine(" if (iconName.StartsWith(\"\\u\") && iconName.Length == 6)");
sb.AppendLine(" {");
sb.AppendLine(" try");
sb.AppendLine(" {");
sb.AppendLine(" var code = Convert.ToInt32(iconName.Substring(2), 16);");
sb.AppendLine(" iconName = char.ConvertFromUtf32(code);");
sb.AppendLine(" }");
sb.AppendLine(" catch");
sb.AppendLine(" {");
sb.AppendLine(" Debug.LogWarning($\"Failed to convert escape sequence: {iconName}\");");
sb.AppendLine(" }");
sb.AppendLine(" }");
sb.AppendLine(" ");
sb.AppendLine(" if(IsIconChar(iconName)) return iconName;");
sb.AppendLine(" return _iconsByName.TryGetValue(iconName, out var icon) ? icon : string.Empty;");
sb.AppendLine(" return _iconsByName.TryGetValue(iconName.ToLower(), out var icon) ? icon : string.Empty;");
sb.AppendLine(" }");
sb.AppendLine();
@@ -482,6 +496,19 @@ namespace UVC.UIToolkit.Editor
sb.AppendLine(" public static bool IsIconChar(string iconChar) => _iconsByName.Values.Contains(iconChar);");
sb.AppendLine();
sb.AppendLine(" /// <summary>");
sb.AppendLine(" /// 유니코드 문자로 아이콘 이름을 조회합니다.");
sb.AppendLine(" /// </summary>");
sb.AppendLine(" public static string GetIconNameByChar(string iconChar)");
sb.AppendLine(" {");
sb.AppendLine(" foreach (var kvp in _iconsByName)");
sb.AppendLine(" {");
sb.AppendLine(" if (string.Equals(kvp.Value, iconChar, StringComparison.OrdinalIgnoreCase)) return kvp.Key;");
sb.AppendLine(" }");
sb.AppendLine(" return string.Empty;");
sb.AppendLine(" }");
sb.AppendLine();
sb.AppendLine(" /// <summary>");
sb.AppendLine(" /// 모든 아이콘 이름 목록을 반환합니다.");
sb.AppendLine(" /// </summary>");