2026-04-13 스킬,퀵슬롯 시스템 수정중

This commit is contained in:
2026-04-13 18:04:55 +09:00
parent de0ba90953
commit 71a6fda0da
57 changed files with 9074 additions and 59 deletions

View File

@@ -0,0 +1,43 @@
using System.Collections.Generic;
using UnityEngine;
public class SkillWindowUI : MonoBehaviour
{
[SerializeField] private Transform _listContentRoot;
[SerializeField] private GameObject _skillEntryPrefab;
private readonly List<SkillEntry> _entries = new List<SkillEntry>();
public void Toggle()
{
bool willOpen = !gameObject.activeSelf;
gameObject.SetActive(willOpen);
if (willOpen) Refresh();
}
public void Refresh()
{
// 기존 엔트리 정리
foreach (Transform child in _listContentRoot)
Destroy(child.gameObject);
_entries.Clear();
var character = GameManager.Instance.Level.CurrentCharacter;
if (character == null) return;
if (!character.TryGetComponent<SkillModule>(out var skillModule)) return;
var skills = skillModule.GetEquippedSkillDatas();
for (int i = 0; i < skills.Count; i++)
{
if (skills[i] == null) continue;
GameObject entryObj = Instantiate(_skillEntryPrefab, _listContentRoot);
SkillEntry entry = entryObj.GetComponent<SkillEntry>();
if (entry != null)
{
entry.SetData(skills[i]);
_entries.Add(entry);
}
}
}
}