To create a music-loop manager, do the following:
- Create a new Unity 3D project and import the provided sound clip files.
- Create four GameObjects in the scene containing an AudioSource component linked to different AudioClip loops from the 140 bpm files provided. This can be done in a single step by dragging the music clip from the Project panel into either the Hierarchy or Scene panels.
- In the Inspector, uncheck the Play On Awake parameter for all four AudioSource components (so they don't start playing until we tell them to).
- Add a new empty GameObject named musicScheduler to the scene.
- Create a C# script class, LoopScheduler, in a new folder, _Scripts, containing the following code, and add an instance as a scripted ...