fix: 아이콘이 정상적으로 출력되지 않는 오류 수정

This commit is contained in:
aube.lee
2025-03-10 01:50:20 +09:00
parent d5d56ca8cc
commit 9e925a6c86
19 changed files with 67 additions and 59 deletions

View File

@@ -97,7 +97,7 @@ namespace TON
// UpdateUI();
});
}
public void UseGold(int amount, System.Action<bool> callback)
public void UseGold(int amount, System.Action<bool> callback = null)
{
if (goldAmount - amount < 0)
{

View File

@@ -1,12 +1,12 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine.UI;
using UnityEngine;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
namespace TON
{
public class ControllerUI_ItemButton : MonoBehaviour
public class PotionButtonItem : MonoBehaviour
{
[SerializeField] private TextMeshProUGUI coolTimeText;
[SerializeField] private Image coolTimeDimd;

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: e5f063d17b315ac49b03acf8e9dd20b4
guid: d4025d96cfa84304caf95db6a4f49d0c
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -7,7 +7,7 @@ using UnityEngine.UI;
namespace TON
{
public class ControllerUI_SkillButton : MonoBehaviour
public class SkillButtonItem : MonoBehaviour
{
[SerializeField] private TextMeshProUGUI coolTimeText;
[SerializeField] private Image coolTimeDimd;
@@ -63,6 +63,5 @@ namespace TON
{
UpdateCooldownUI(); // UI 업데이트
}
}
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: e890b5f706c997b4396fb3fc11938954
guid: f9d99c36ec531604e82c8aeebd6afa80
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -6,7 +6,7 @@ using UnityEngine.UI;
namespace TON
{
public class SkillSettingUI_SkillSlot : MonoBehaviour
public class SkillSettingSlot : MonoBehaviour
{
public GameObject skillImage;
public GameObject lockerImage;

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 19db9b1bf85c67042afc28005a6af101
guid: 9cc7099481cd73d40a0c87d18da714c4
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,9 +1,7 @@
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
namespace TON
@@ -18,11 +16,11 @@ namespace TON
public Transform skillButtonGroup;
public ControllerUI_SkillButton skillButtonPrefab;
private List<ControllerUI_SkillButton> createdSkillButtons = new List<ControllerUI_SkillButton>();
public SkillButtonItem skillButtonPrefab;
private List<SkillButtonItem> createdSkillButtons = new List<SkillButtonItem>();
public UserItemData userItem { get; private set; } = new UserItemData();
// 보유 포션 수량
// 보유 포션 수량
[SerializeField] private TextMeshProUGUI hpPotionCount;
[SerializeField] private TextMeshProUGUI mpPotionCount;
@@ -30,7 +28,7 @@ namespace TON
private int hpPotion = 0;
private int mpPotion = 0;
public List<ControllerUI_ItemButton> itemButtons = new List<ControllerUI_ItemButton>();
public List<PotionButtonItem> itemButtons = new List<PotionButtonItem>();
private void OnEnable()
{
@@ -60,7 +58,7 @@ namespace TON
List<SkillBase> activatedSkills = SkillDataManager.Singleton.GetEquippedSkills();
for (int i = 0; i < 3; i++)
{
ControllerUI_SkillButton newSkillButton = Instantiate(skillButtonPrefab, skillButtonGroup);
SkillButtonItem newSkillButton = Instantiate(skillButtonPrefab, skillButtonGroup);
newSkillButton.gameObject.SetActive(true);
if (i < activatedSkills.Count) // 해당 인덱스에 활성화된 스킬이 있을 경우
@@ -69,7 +67,7 @@ namespace TON
}
else
{
// 복제 됐을때 기본 상태가 잠금 상태
// 복제 됐을때 기본 상태가 잠금 상태
newSkillButton.GetComponent<Button>().interactable = false;
}
@@ -141,7 +139,7 @@ namespace TON
linkedCharactor.Attack();
}
public void OnClickSkillButton(ControllerUI_SkillButton button)
public void OnClickSkillButton(SkillButtonItem button)
{
linkedCharactor.SkillAttack(button.skillBase.SkillData.id);
}

View File

@@ -1,4 +1,3 @@
using System;
using System.Collections;
using System.Collections.Generic;
using TMPro;
@@ -8,7 +7,7 @@ using UnityEngine.UI;
namespace TON
{
public class RankingUI_RankBox : MonoBehaviour
public class RankBoxItem : MonoBehaviour
{
[SerializeField] private GameObject rankBoxImage;
[SerializeField] private GameObject pawImage;

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 35c94c75c6e511048b4a77d3682e1f85
guid: 4d47caa84e9a090419eb82f5e455a86d
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -13,9 +13,9 @@ namespace TON
// 전체 랭킹 리스트를 스크롤 형식으로 구현하기 위함
public ScrollRect scrollRect;
public RankingUI_RankBox rankBoxPrefab;
public RankBoxItem rankBoxPrefab;
public List<RectTransform> uiPrefabList = new List<RectTransform>();
public List<RankingUI_RankBox> createRankList = new List<RankingUI_RankBox>();
public List<RankBoxItem> createRankList = new List<RankBoxItem>();
[SerializeField] private GameObject errorPopup;
[SerializeField] private GameObject pawImage;
@@ -76,7 +76,7 @@ namespace TON
for (int i = 0; i < rankList.Count; i++)
{
ClearData clearData = rankList[i];
RankingUI_RankBox rankBox = Instantiate(rankBoxPrefab, scrollRect.content);
RankBoxItem rankBox = Instantiate(rankBoxPrefab, scrollRect.content);
rankBox.gameObject.SetActive(true);
rankBox.Initalize(i + 1, clearData);

View File

@@ -12,8 +12,8 @@ namespace TON
// 사용할 스킬 슬롯 3개 매핑을 위한 변수
public Transform skillSlotGroup;
public SkillSettingUI_SkillSlot skillSlotPrefab;
public List<SkillSettingUI_SkillSlot> createSkillSlots = new List<SkillSettingUI_SkillSlot>();
public SkillSettingSlot skillSlotPrefab;
public List<SkillSettingSlot> createSkillSlots = new List<SkillSettingSlot>();
// 전체 스킬 리스트를 스크롤 형식으로 구현하기 위함
public ScrollRect scrollRect;
@@ -73,7 +73,7 @@ namespace TON
for (int i = 0; i < 3; i++)
{
SkillSettingUI_SkillSlot newSkillSlot = Instantiate(skillSlotPrefab, skillSlotGroup);
SkillSettingSlot newSkillSlot = Instantiate(skillSlotPrefab, skillSlotGroup);
newSkillSlot.gameObject.SetActive(true);
if (skillMap.TryGetValue(i, out SkillBase skill))
@@ -144,7 +144,7 @@ namespace TON
public void OnClickSkillSlot()
{
GameObject selectedSlotGameObject = EventSystem.current.currentSelectedGameObject;
SkillSettingUI_SkillSlot selectedSlot = selectedSlotGameObject.GetComponent<SkillSettingUI_SkillSlot>();
SkillSettingSlot selectedSlot = selectedSlotGameObject.GetComponent<SkillSettingSlot>();
selectedSlotIndex = selectedSlot.SelectedSlot();
for (int i = 0; i < 3; i++)
@@ -201,7 +201,7 @@ namespace TON
IEnumerator CloseButtonDelay()
{
yield return new WaitForSeconds(0.2f); // 0.2초 대기
UIManager.Hide<SkillSettingUI>(UIList.SkillSettingUI);
}
}