feat: add player avatar catalog
This commit is contained in:
@@ -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";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user