2026-06-11 사운드시스템 (BaseScene참고)
This commit is contained in:
@@ -1,9 +1,16 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
public class GameManager : MonoBehaviour,ISceneInitializable
|
||||
{
|
||||
public static GameManager Instance;
|
||||
|
||||
//현재 플레이어가 위치한 구역 (구역 상태의 단일 진실 출처)
|
||||
public Zone CurrentZone { get; private set; } = Zone.None;
|
||||
|
||||
//구역이 바뀌면 발생. 사운드 등 여러 시스템이 구독해서 반응한다.
|
||||
public event Action<Zone> OnZoneChanged;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (Instance == null)
|
||||
@@ -17,8 +24,16 @@ private void Awake()
|
||||
}
|
||||
}
|
||||
|
||||
//구역 변경 요청 (ZoneTrigger 등에서 호출)
|
||||
public void SetZone(Zone zone)
|
||||
{
|
||||
if (zone == CurrentZone) return; //같은 구역이면 무시
|
||||
CurrentZone = zone;
|
||||
OnZoneChanged?.Invoke(zone); //구독자(SoundManager 등)에게 통지
|
||||
}
|
||||
|
||||
public void OnSceneLoaded()
|
||||
{
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user