2026-06-25 문제사항 수정

This commit is contained in:
2026-06-25 13:12:20 +09:00
parent 0733f25a97
commit 51288052b7
4 changed files with 15 additions and 8 deletions

Binary file not shown.

View File

@@ -1,4 +1,5 @@
using UnityEngine; using UnityEngine;
using UnityEngine.Events;
public class StarPickup : MonoBehaviour public class StarPickup : MonoBehaviour
{ {
@@ -20,6 +21,10 @@ public class StarPickup : MonoBehaviour
[Header("Sound")] [Header("Sound")]
public AudioClip pickupSound; public AudioClip pickupSound;
[Header("Events")]
[Tooltip("별을 먹었을 때 발생하는 이벤트입니다.")]
public UnityEvent onCollected;
private Vector3 startPosition; private Vector3 startPosition;
void Awake() void Awake()
@@ -63,11 +68,13 @@ public void CollectStar()
Debug.LogWarning("CollectionManager not found."); Debug.LogWarning("CollectionManager not found.");
} }
if (pickupSound != null && pickupSound != null) if (pickupSound != null)
{ {
SoundManager.Instance.PlaySFX(pickupSound); SoundManager.Instance.PlaySFX(pickupSound);
} }
onCollected?.Invoke();
Destroy(gameObject); Destroy(gameObject);
} }

Binary file not shown.