using System; using UnityEngine; namespace Class03 { // 점수 데이터와 변경 알림만 관리합니다. public sealed class ScoreCounter : MonoBehaviour { [SerializeField, Min(1)] private int targetScore = 8; public int Score { get; private set; } public int TargetScore => targetScore; public event Action Changed; public void AddPoint() { Score++; Changed?.Invoke(Score, targetScore); } } }