fix: Assert 사용하지 않도록 변경

This commit is contained in:
aube.lee
2025-03-17 02:00:46 +09:00
parent 6e0ea12b9e
commit 54adca4e06
3 changed files with 10 additions and 11 deletions

View File

@@ -20,11 +20,11 @@ namespace TON
// 스킬 이미지 세팅하기 // 스킬 이미지 세팅하기
if (skillId != null) // 스킬 슬롯에 스킬이 지정된 경우 if (skillId != null) // 스킬 슬롯에 스킬이 지정된 경우
{ {
// out 으로 받을 변수 초기화 if (AssetManager.Singleton.LoadSkillIcon(skillId, out Sprite loadedSkillImage))
Sprite loadedSkillImage = null; {
Assert.IsTrue(AssetManager.Singleton.LoadSkillIcon(skillId, out loadedSkillImage)); skillImage.SetActive(true);
skillImage.SetActive(true); skillImage.GetComponent<Image>().sprite = loadedSkillImage;
skillImage.GetComponent<Image>().sprite = loadedSkillImage; }
} }
lockerImage.SetActive(false); lockerImage.SetActive(false);

View File

@@ -39,16 +39,14 @@ namespace TON
private void SetMyRankBoxImage() private void SetMyRankBoxImage()
{ {
Sprite loadedMyBoxImage = null; if (AssetManager.Singleton.LoadMyRankBoxImage(out Sprite loadedMyBoxImage))
Assert.IsTrue(AssetManager.Singleton.LoadMyRankBoxImage(out loadedMyBoxImage)); rankBoxImage.GetComponent<Image>().sprite = loadedMyBoxImage;
rankBoxImage.GetComponent<Image>().sprite = loadedMyBoxImage;
} }
private void SetPawIcon(int rank) private void SetPawIcon(int rank)
{ {
Sprite loadedPawImage = null; if (AssetManager.Singleton.LoadRankPawIcon(rank, out Sprite loadedPawImage))
Assert.IsTrue(AssetManager.Singleton.LoadRankPawIcon(rank, out loadedPawImage)); pawImage.GetComponent<Image>().sprite = loadedPawImage;
pawImage.GetComponent<Image>().sprite = loadedPawImage;
} }
} }
} }

View File

@@ -76,6 +76,7 @@ namespace TON
float y = 0; float y = 0;
for (int i = 0; i < rankList.Count; i++) for (int i = 0; i < rankList.Count; i++)
{ {
Debug.Log($"RankList[{i}]: {rankList[i].nickname}");
ClearData clearData = rankList[i]; ClearData clearData = rankList[i];
RankBoxItem rankBox = Instantiate(rankBoxPrefab, scrollRect.content); RankBoxItem rankBox = Instantiate(rankBoxPrefab, scrollRect.content);