12345678910111213141516171819202122232425 |
- using System;
- using UnityEngine;
- using UnityEngine.UI;
- namespace UI.Hall
- {
- public class AvatarUtil
- {
- public static void DisplayAvatar(Image image, string avatarIdString)
- {
- var avatarId = 1;
- try
- {
- avatarId = int.Parse(avatarIdString);
- }
- catch (Exception e)
- {
-
- }
- var s = Resources.Load<Sprite>("Image/Avatar/" + avatarId.ToString("D3"));
- image.sprite = s;
- }
- }
- }
|