April 2020
Intermediate to advanced
716 pages
18h 55m
English
In order to load any static asset files such as image or audio files in the code, we can utilize the asset method in React 360. This asset() functionality in React 360 allows us to retrieve external resource files, including audio and image files.
For example, we will place the sound audio files for the game in the static_assets folder, to be retrieved using asset() for each audio added to the game, as shown in the following code:
AudioModule.playOneShot({ source: asset('collect.mp3'),})
This will load the audio file to be played in the call to playOneShot.
With these different APIs and modules available in React 360, we will integrate different features for the VR game such as setting the background scene, playing audio, ...