Created
April 8, 2021 13:24
-
-
Save silenciocorner/4c55b68a59059c9846e4f6498c9db2c4 to your computer and use it in GitHub Desktop.
BeatmapEventCallbacks from MusicManager.cs script from Colin Vandervort article "FMOD Unity: Beat-Mapping"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class MusicManager : MonoBehaviour | |
| { | |
| ... | |
| private void Awake() | |
| { | |
| ... | |
| } | |
| private void Start() | |
| { | |
| timelineInfo = new TimelineInfo(); | |
| beatCallback = new FMOD.Studio.EVENT_CALLBACK(BeatEventCallback); | |
| timelineHandle = GCHandle.Alloc(timelineInfo, GCHandleType.Pinned); | |
| musicPlayEvent.setUserData(GCHandle.ToIntPtr(timelineHandle)); | |
| musicPlayEvent.setCallback(beatCallback, FMOD.Studio.EVENT_CALLBACK_TYPE.TIMELINE_BEAT | FMOD.Studio.EVENT_CALLBACK_TYPE.TIMELINE_MARKER); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment