CRIWARE Unity Plugin Manual  Last Updated: 2024-07-12
[CriMana] Movie playback using Timeline expansion

Description of the sample

Overview

cri4u_samples_crimana_adv05_screenshot.png

This is a sample to play movie with Timeline expansion plug-in.

Operating instructions

  • Movie playback starts at the start of the scene.
    A progress bar indicates the playback position.
  • When the Pause button is pressed, movie playback is paused. (The last frame remains displayed)
  • When the Stop button is pressed, movie playback is stopped and the playback position is set to 0 seconds. (Movie disappears)
  • When the Play button is pressed, start / resume movie sequence playback.
Operations in the editor
cri4u_samples_crimana_adv05_timeline.png
When this sample game object "ManaTimeline" is selected, the timeline assets to be played are displayed in the Timeline window.
Move the Timeline playback position in Edit mode to scrub movie playback on the game screen.

Scene information


Middleware CRI Sofdec (CRI Mana)
Sample Advanced sample
Location /CRIWARE/SDK/unity/samples/UnityProject/Assets/Scenes/crimana/advanced/
Scene file Scene_05_TimelineExtension.unity
Timeline file Scene_05_TimelineExtension.playable


Description of the program

About Timeline Assets

The Timeline asset (.playable file) played in this sample is set in the PlayableDirector component of the game object "ManaTimeline".
In the Timeline window, you can add and edit CRI Mana tracks and clips.

About playback control

Playback control of Timeline is realized by Assets/Scripts/TimelineControl.cs (sample common script).
/* Code excerpt */
director = GetComponent<PlayableDirector>();
if (Scene_00_GUI.Button(playButtonRect, "Play")) {
director.Play();
}
if (Scene_00_GUI.Button(pauseButtonRect, "Pause")) {
director.Pause();
}
if (Scene_00_GUI.Button(stopButtonRect, "Stop")) {
director.Stop();
}
When paused, playback is resumed by executing Play().