中文 | English

RocketDriver Pro

Logo

RocketDriver Pro is a game framework for Unity engine


5. Audio Manager (AudioManager)

The perfect audio management module supports scene and UI music sound effects, and removes the dependency of Assetbundle.

5.1 Initialization

5.1.1 Generate configuration assets

Execute menu “Tools -> RocketDriver -> Project -> Gen AudioSettings”.
The AudioSettings.asset (renameable) file will be generated under the project Assets/Resources.
image

5.1.2 Setting up management objects

Copy JLGames/RocketDriver/Assets/AudioManager/Prefabs/AudioManager.prefab to the project initialization scene, and re-associate AudioSettings.asset
image

5.1.3 Set the audio loader:

AudioManagerPool.Shared.SetLoaderAdapter(new AudioLoader());

If you need to customize the loading, you can implement the IAudioLoader interface.

5.2 Use

5.2.1 Register audio information (optional)

Audio information can be registered in the script using the AudioManager function
image
image

5.2.2 Play music, play sound effects

5.2.3 Audio Settings

AudioDemoMusicNode and AudioDemoSoundNode components in the example.

5.3 Example

JLGames/RocketDriver/Samples/Audio
image