From 0ce3b18bfeb82ba381b23148b2eb23af49bd2561 Mon Sep 17 00:00:00 2001 From: ud18010 Date: Tue, 4 Aug 2026 15:06:40 +0800 Subject: [PATCH] feat: add player avatar catalog --- .../Module/Player/PlayerAvatarCatalog.cs | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Client/Assets/Script/xmain/Module/Player/PlayerAvatarCatalog.cs diff --git a/Client/Assets/Script/xmain/Module/Player/PlayerAvatarCatalog.cs b/Client/Assets/Script/xmain/Module/Player/PlayerAvatarCatalog.cs new file mode 100644 index 00000000..37dce293 --- /dev/null +++ b/Client/Assets/Script/xmain/Module/Player/PlayerAvatarCatalog.cs @@ -0,0 +1,22 @@ +using System.Globalization; + +namespace XGame +{ + public static class PlayerAvatarCatalog + { + public const int Count = 54; + public const int DefaultAvatarId = 1; + private const string AssetRoot = "Assets/Game/Art/UI/Texture/Icon/GamerPic/GamerPic_"; + + public static int NormalizeId(int avatarId) + { + return avatarId >= DefaultAvatarId && avatarId <= Count ? avatarId : DefaultAvatarId; + } + + public static string GetAssetPath(int avatarId) + { + int normalizedId = NormalizeId(avatarId); + return AssetRoot + normalizedId.ToString("00", CultureInfo.InvariantCulture) + ".png"; + } + } +}