feat: player icon load 로직 수정
This commit is contained in:
@@ -5,6 +5,15 @@ using UnityEngine;
|
||||
|
||||
namespace TON
|
||||
{
|
||||
public enum FaceStatue
|
||||
{
|
||||
Idle,
|
||||
Angry,
|
||||
Sad,
|
||||
Oh,
|
||||
Smile
|
||||
}
|
||||
|
||||
public class AssetManager : SingletonBase<AssetManager>
|
||||
{
|
||||
|
||||
@@ -19,10 +28,10 @@ namespace TON
|
||||
return LoadAsset<Sprite>($"UI/Skill Icon/skill_icon_{skillId}", out result);
|
||||
}
|
||||
|
||||
public bool LoadPlayerIcon(string playerType, out Sprite result)
|
||||
public bool LoadPlayerIcon(string playerType, FaceStatue status, out Sprite result)
|
||||
{
|
||||
var playerColor = playerType == "b" ? "Black" : "White";
|
||||
return LoadAsset<Sprite>($"UI/Player/{playerColor}_Cat", out result);
|
||||
return LoadAsset<Sprite>($"Player/Character Face/{playerColor}_{status}", out result);
|
||||
}
|
||||
|
||||
public bool LoadStageIcon(string stageId, out Sprite result)
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace TON
|
||||
PlayerData player = PlayerDataManager.Singleton.player;
|
||||
|
||||
Image playerObj = GameObject.Find("TON.Player").GetComponent<Image>();
|
||||
playerObj.sprite = AssetManager.Singleton.LoadPlayerIcon(player.type, out Sprite playerImage) ? playerImage : null;
|
||||
playerObj.sprite = AssetManager.Singleton.LoadPlayerIcon(player.type, FaceStatue.Idle, out Sprite playerImage) ? playerImage : null;
|
||||
|
||||
characterName.text = player.name;
|
||||
characterHp.text = $"{player.hp}";
|
||||
|
||||
Reference in New Issue
Block a user