Skip to content

Instantly share code, notes, and snippets.

@silenciocorner
Created April 8, 2021 13:29
Show Gist options
  • Save silenciocorner/3dcdc832caf318db30a9b7c2abb0eb7f to your computer and use it in GitHub Desktop.
Save silenciocorner/3dcdc832caf318db30a9b7c2abb0eb7f to your computer and use it in GitHub Desktop.
OnDestroy of MusicManager.cs script from Colin Vandervort article "FMOD Unity: Beat-Mapping"
public class MusicManager : MonoBehaviour
{
...
void OnDestroy()
{
musicPlayEvent.setUserData(IntPtr.Zero);
musicPlayEvent.stop(FMOD.Studio.STOP_MODE.IMMEDIATE);
musicPlayEvent.release();
timelineHandle.Free();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment