MovieRecorder
public sealed class MovieRecorder Records properties in a scene to tracks ready for use in a MoviePlayer. You can use this for in-game demo recording of a whole scene, or only specific properties, configured using MovieRecorderOptions. You can manually call MovieTime) to move the recording time along, then Capture to write all recorded properties to tracks. Alternatively, call Start to automatically advance and capture every fixed update, and Stop to finish recording. Convert the recording to a MovieClip by calling ToClip. This clip can then be played back immediately, or serialized to later use.
Constructors
MovieRecorder(Scene scene, MovieRecorderOptions options) Create a new MovieRecorder, recording the given with the given .
scene — Scene to record. options — Optional configuration, defaults to Default. MovieRecorder(TrackBinder binder, MovieRecorderOptions options) Create a new MovieRecorder with the given and .
binder — Binder to map tracks to objects in a scene. options — Optional configuration, defaults to Default. Properties
| Name | Type | Description |
|---|---|---|
Options | MovieRecorderOptions | Configuration deciding which properties are captured, and at what sample rate. |
Binder | TrackBinder | Maps tracks to objects and properties in the scene. |
Scene | Scene | Scene we're recording. Will match Scene. |
TimeRange | MovieTimeRange | Recorded time range, spanning from the first capture to the current value of Time. |
RecordedThisFrame | IEnumerable<IMovieTrackRecorder> | Which IMovieTrackRecorders recorded anything during the last call to Capture. |
Time | MovieTime | Current recording time, increased by calling MovieTime). |
Methods
IMovieTrackRecorder GetTrackRecorder(GameObject gameObject) Gets a IMovieTrackRecorder for the given , creating one if it doesn't exist. If Filters reject this game object, returns null instead.
gameObject — Object in the scene to record. IMovieTrackRecorder GetTrackRecorder(IValid gameObjectOrComponent) IMovieTrackRecorder GetTrackRecorder(Component component) Gets a IMovieTrackRecorder for the given , creating one if it doesn't exist. If Filters reject the component's game object, returns null instead. Calling Capture on the returned recorder will use IComponentCapturers to decide which properties to capture. These handlers are configured using ComponentCapturers.
component — Component in the scene to record. IMovieTrackRecorder GetTrackRecorder(ITrack track) Gets a IMovieTrackRecorder for the given , creating one if it doesn't exist. If Filters reject whatever game object the track is bound to, returns null instead.
track — Track to record. IDisposable Start() Starts recording the scene. Stop recording by calling Stop, or disposing the returned object. Recording will automatically stop when the recorded scene is being destroyed.
Void Stop() Stop recording the scene. Does nothing if you haven't called Start.
Void Advance(MovieTime deltaTime) Moves recording ahead by the given . This will happen automatically if you've called Start.
Void Capture() Runs all actions in CaptureActions. This will happen automatically if you've called Start.
MovieClip ToClip() Convert the current recording to a MovieClip that can be serialized or played back.
IMovieResource ToResource() Convert the current recording to a IMovieResource that can be saved as a .movie asset.