void OnDestroy() { EventBroadcaster.RemoveActionAtObserver(EventNames.PlayOneShot, HandleOnPlayOneShotRequest); EventBroadcaster.RemoveActionAtObserver(EventNames.ToggleBGM, HandleOnToggleBGM); EventBroadcaster.RemoveActionAtObserver(EventNames.ToggleSFX, HandleOnToggleSFX); }
void Start() { EventBroadcaster.AddObserver(EventNames.PlayOneShot, HandleOnPlayOneShotRequest); EventBroadcaster.AddObserver(EventNames.ToggleBGM, HandleOnToggleBGM); EventBroadcaster.AddObserver(EventNames.ToggleSFX, HandleOnToggleSFX); }