Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [SerializeField] EventReference m_BackgroundMusic;
- private EventInstance _backgroundMusicEventInstance;
- PLAYBACK_STATE _playbackState;
- private void Start()
- {
- _backgroundMusicEventInstance = RuntimeManager.CreateInstance(m_BackgroundMusic);
- _backgroundMusicEventInstance.start();
- }
- private void Update()
- {
- _backgroundMusicEventInstance.getPlaybackState(out _playbackState);
- if (_playbackState == PLAYBACK_STATE.STOPPED)
- {
- _backgroundMusicEventInstance.start();
- Debug.Log($"Restarting music");
- Debug.Log($"Playback state: {_playbackState}");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement