CRIWARE Unity Plugin Manual  Last Updated: 2024-07-12
[CriAtom] Switching scenes without interrupting the BGM

Sample description

Overview

cri4u_samples_criatom_adv02_game_mini.png

This sample switches scenes without interrupting the BGM.
You can switch scenes by clicking on the "Push to Change Scene" button on the screen.

Scene information


Middleware CRI ADX (CRI Atom)
Sample Advanced samples
Location /CRIWARE/SDK/unity/samples/UnityProject/Assets/Scenes/criatom/advanced/
Scene file Scene_02_OverScenePlayback.unity


Description of the program

[CRIWARE (Don't Destroy)] object

For the CriAtom component of this object, the Don't Destroy option is selected.
This means that it will not be destroyed even if a new scene is loaded.
By attaching the CriAtomSource to the child of this object, you can create data that continues to be played instead of being destroyed.

Difference from the Script sample

The difference from the Sound control across scenes in [CriAtom] Script samples of CRI ADX is described below.
Both samples are identical in that they play sounds across scenes.
This sample sets the hierarchy so that the CRI Atom Source can be used continuously without writing any script. Meanwhile, Sound control across scenes continues to use a script that creates an application for sound control.
Use either method depending on what fits better your program.