Simple music with introduction player.
Yes, you'll need to prepare your music by splitting it into an "intro" and a "loop" section as separate audio files.
Instructions (Unity 2017.3):
- Create an Empty Object, label it "BGM Player"
- Right click on "BGM Player", Create an Audio Source labelled "Intro". Uncheck "Play on Awake".
- Right click on "BGM Player", Create an Audio Source labelled "Loop". Uncheck "Play on Awake". Check "Loop".
- Click on "BGM Player" and add the "AudioLoopWithIntro" script.
- Drag "Intro" and "Loop" objects into the two corresponding script properties.
- Make a Prefab of this
- Assign an Audio Clip to each of the two Audio Source objects.