CRIWARE Unity Plugin Manual  Last Updated: 2024-07-12
CriManaMovieControllerForAsset Class Reference

Movie playback component for CRI Assets More...

Inherits CriManaMovieMaterialBase.

Public Types

enum  MaxFrameDrop
 Maximum frame drop number type
 
enum  RenderMode
 Material rendering mode type More...
 

Public Member Functions

delegate void OnApplicationPauseCallback (CriManaMovieMaterialBase manaMovieMaterial, bool appPause)
 Callback delegate on application pause More...
 
void Play ()
 Start playback. More...
 
void Stop ()
 Requests to stop movie playback. More...
 
void Pause (bool sw)
 Pauses/unpauses the movie playback. More...
 
void PlayerManualInitialize ()
 Initializes the player (for manual) More...
 
void PlayerManualFinalize ()
 Terminates the player (for manual) More...
 
void PlayerManualSetup ()
 Prepares the player (for manual) More...
 
void PlayerManualUpdate ()
 Updates the player frame (for manual) More...
 

Public Attributes

bool useOriginalMaterial
 Whether to display the original Material when movie frames are not available. More...
 
bool playOnStart = false
 Sets whether to play at Start. More...
 
bool restartOnEnable = false
 A setting whether to play from the start on OnEnable. More...
 
RenderMode renderMode = RenderMode.Always
 Material rendering mode More...
 
OnApplicationPauseCallback onApplicationPauseCallback = null
 Callback on application pause More...
 

Protected Member Functions

virtual void OnMaterialUpdated ()
 A method called when a new frame is fed to the Material. More...
 

Properties

ICriManaMovieMaterialTarget Target [get, set]
 The target to which the MovieMaterial will be set. More...
 
MaxFrameDrop maxFrameDrop [get, set]
 Sets the maximum number of frame drops. More...
 
bool isMaterialAvailable [get]
 Whether movie frames can be rendered with CriManaMovieMaterial::material More...
 
CriMana.Player player [get]
 Playback control player More...
 
Material material [get, set]
 Sets the Material for feeding the movie. More...
 

Detailed Description

Movie playback component for CRI Assets

Description:
This component is used to play USM assets in a scene.
The movie is played back as a Renderer or Graphic material specified by this component.

Member Enumeration Documentation

enum RenderMode
stronginherited

Material rendering mode type

Description:
A type which indicates how the video should be rendered on the Material.
  • Always: Draw every frame.
  • OnVisibility: Renders if the GameObject is the rendering target (if active for UI.Graphic).
  • Never: Do not render. You must explicitly call CriManaMovieMaterial::RenderMovie to do the rendering.

Member Function Documentation

delegate void OnApplicationPauseCallback ( CriManaMovieMaterialBase  manaMovieMaterial,
bool  appPause 
)
inherited

Callback delegate on application pause

Description:
A callback delegate called at the time of suspend/resume or when the application pauses such as by pressing the pause button while running the Editor.
void Play ( )
inlineinherited

Start playback.

Description:
Starts movie playback.
When playback starts, the status ( CriWare.CriMana::Player::Status ) changes to Playing.
Note:
After calling this function, it takes several frames before the rendering of movie actually starts.
If you want to synchronize the movie playback, instead of using this function, access the player property, and prepare for playback in advance using the CriMana::Player::Prepare function.
See also
CriManaMovieMaterial::Stop, CriMana::Player::Status
void Stop ( )
inlineinherited

Requests to stop movie playback.

Description:
Issues a request to stop movie playback. This function returns immediately.
The rendering ends immediately when you call this function, but the playback does not stop immediately.
See also
CriMana::Player::Status
void Pause ( bool  sw)
inlineinherited

Pauses/unpauses the movie playback.

Parameters
swPause switch (true: pause, false: resume)
Description:
Turns the pause on and off.
Pauses the playback if the argument is true, resumes the playback if it is false.
The pause state will be cleared when CriManaMovieMaterial::Stop is called.
virtual void OnMaterialUpdated ( )
inlineprotectedvirtualinherited

A method called when a new frame is fed to the Material.

Description:
A method called when a new frame is fed to the Material.
It is supposed to be overridden in the inherited class.
void PlayerManualInitialize ( )
inlineinherited

Initializes the player (for manual)

Description:
Manually initializes the player.
Note:
Since it is usually called from the Awake function, it is not required to call this function separately.
Use this function only if you want to perform initialization manually for editor extension etc.
void PlayerManualFinalize ( )
inlineinherited

Terminates the player (for manual)

Description:
Manually terminates the player.
Note:
This function is called from OnDestroy(), therefore it is not necessary to call it manually.
Call this function only when you want to perform initialization manually (e.g., for editor customization).
void PlayerManualSetup ( )
inlineinherited

Prepares the player (for manual)

Description:
Manually prepares the player.
Note:
Since it is usually called from the Start function, it is not required to call this function separately.
Use this function if you want perform preparation manually for editor extension etc.
void PlayerManualUpdate ( )
inlineinherited

Updates the player frame (for manual)

Description:
Manually updates the player frame.
Note:
Since it is usually called from the Update function, it is not required to call this function separately.
Use this function if you want update frames manually for editor extension etc.

Member Data Documentation

bool useOriginalMaterial

Whether to display the original Material when movie frames are not available.

Description:
Whether to display the original material when a movie frame is not available.
true : display the original material when a movie frame is not available.
false : disable the rendering of the target when a movie frame is not available.
bool playOnStart = false
inherited

Sets whether to play at Start.

Description:
Specifies whether playback is to be performed on Start. The default value is false.
bool restartOnEnable = false
inherited

A setting whether to play from the start on OnEnable.

Description:
If true, the playback will start over from the beginning when a component is disabled during playback and then re-enabled.
The default value is false.
RenderMode renderMode = RenderMode.Always
inherited

Material rendering mode

Description:
Sets how the video is rendered for the Material.
Note:
On some platforms (PC/iOS, etc.), rendering is always done regardless of this setting.
OnApplicationPauseCallback onApplicationPauseCallback = null
inherited

Callback on application pause

Description:
Sets the processing when the application is paused/resumed.
The behavior if not set (when null is specified) is "paused at start, resumed at end (remains paused if it was already paused at the)".
If you want to change the above behavior in the application side, set your own callback process in this property.

Property Documentation

ICriManaMovieMaterialTarget Target
getset

The target to which the MovieMaterial will be set.

Description:
ICriManaMovieMaterialTarget to which to set the MovieMaterial.
MaxFrameDrop maxFrameDrop
getsetinherited

Sets the maximum number of frame drops.

Description:
Sets the maximum number of frames to be dropped in one update if the update of rendered frames is not keeping up with the playback.
This allows intended playback if the frame rate of the application is low or when the playback speed of the video is raised higher than the frame rate.
bool isMaterialAvailable
getinherited

Whether movie frames can be rendered with CriManaMovieMaterial::material

Description:
Indicates whether movie frames can be rendered with CriManaMovieMaterial::material.
CriMana.Player player
getinherited

Playback control player

Description:
A player property for fine movie playback control.
If you want to perform operations other than Start/Stop/Pause, use the CriMana::Player API via this property.
Material material
getsetinherited

Sets the Material for feeding the movie.

Description:
If you set a Material, the movie is fed to that Material.
If you do not set a Material, a Material to which the movie is fed is created.
Note:
If you set a Material, it must be set before the Start method is called.

The documentation for this class was generated from the following file: