별조각픽업

This commit is contained in:
2026-06-24 20:36:39 +09:00
parent b92bb65ba6
commit 5ff460f9c3
19 changed files with 355 additions and 6 deletions

View File

@@ -0,0 +1,46 @@
using UnityEngine;
public class CollectionManager : MonoBehaviour
{
public static CollectionManager Instance;
[Header("Star Data")]
private int _currentStars = 0;
[Header("CollectionHuds")]
[SerializeField] private StarPieceHud _starPieceHud;
public int GetStarCount => _currentStars;
void Awake()
{
if (Instance != null && Instance != this)
{
Destroy(gameObject);
return;
}
Instance = this;
DontDestroyOnLoad(gameObject);
}
void Start()
{
UpdateUI();
}
public void AddStar(int amount)
{
_currentStars += amount;
UpdateUI();
Debug.Log("Star Added: " + amount + " / Total Star: " + _currentStars);
}
void UpdateUI()
{
if(_starPieceHud != null)
{
_starPieceHud.RefreshUI();
}
}
}