Class CutsceneBuilder
Builds a local, camera-driven cutscene with a managed cross-runtime API.
public sealed class CutsceneBuilder
- Inheritance
-
CutsceneBuilder
- Inherited Members
- Extension Methods
Constructors
CutsceneBuilder(string)
Creates a builder for a uniquely identified local cutscene.
public CutsceneBuilder(string id)
Parameters
idstringA stable, mod-namespaced identifier such as
my-mod:crew-arrival.
Methods
Build()
Builds a reusable managed handle for the configured cutscene.
public CutsceneHandle Build()
Returns
- CutsceneHandle
A cutscene handle that can start and control local playback.
Exceptions
- InvalidOperationException
Thrown when duration or the initial camera pose has not been configured.
OnEnded(Action<CutsceneEndReason>)
Sets the callback invoked exactly once when a playback attempt ends.
public CutsceneBuilder OnEnded(Action<CutsceneEndReason> callback)
Parameters
callbackAction<CutsceneEndReason>The callback that receives the reason playback ended.
Returns
- CutsceneBuilder
This builder for method chaining.
OnStarted(Action)
Sets the callback invoked after native playback starts successfully.
public CutsceneBuilder OnStarted(Action callback)
Parameters
callbackActionThe playback-started callback.
Returns
- CutsceneBuilder
This builder for method chaining.
WithCameraUpdate(Action<CutsceneFrame>)
Sets the callback that updates the managed camera transform each frame.
public CutsceneBuilder WithCameraUpdate(Action<CutsceneFrame> update)
Parameters
updateAction<CutsceneFrame>The per-frame camera callback.
Returns
- CutsceneBuilder
This builder for method chaining.
WithDuration(float)
Sets the cutscene playback duration.
public CutsceneBuilder WithDuration(float seconds)
Parameters
secondsfloatA finite duration greater than zero, in seconds.
Returns
- CutsceneBuilder
This builder for method chaining.
WithFadeIn(float)
Fades from black when playback begins.
public CutsceneBuilder WithFadeIn(float seconds)
Parameters
secondsfloatA finite fade duration greater than or equal to zero.
Returns
- CutsceneBuilder
This builder for method chaining.
Remarks
The helper does not alter a black overlay that was already shown by another game system. A duration of zero disables the helper.
WithFadeIn(float, float)
Holds on black, then fades in after a delay.
public CutsceneBuilder WithFadeIn(float seconds, float delaySeconds)
Parameters
secondsfloatA finite fade duration greater than or equal to zero.
delaySecondsfloatA finite delay greater than or equal to zero before the fade begins.
Returns
- CutsceneBuilder
This builder for method chaining.
Remarks
The helper does not alter a black overlay that was already shown by another game system. A fade duration of zero disables the helper.
WithFadeOut(float)
Fades to black near the end of normal playback, then releases the overlay.
public CutsceneBuilder WithFadeOut(float seconds)
Parameters
secondsfloatA finite fade duration greater than or equal to zero.
Returns
- CutsceneBuilder
This builder for method chaining.
Remarks
The helper does not close a black overlay that was already owned by another game system. A duration of zero disables the helper.
WithFov(float)
Overrides the player camera's field of view while the cutscene is active.
public CutsceneBuilder WithFov(float fov)
Parameters
fovfloatA finite field of view greater than zero and less than 180 degrees.
Returns
- CutsceneBuilder
This builder for method chaining.
WithHoldToSkip(float)
Allows the local player to hold primary click to skip playback.
public CutsceneBuilder WithHoldToSkip(float seconds = 0.5)
Parameters
secondsfloatThe finite hold duration required to skip.
Returns
- CutsceneBuilder
This builder for method chaining.
WithInitialCamera(Vector3, Quaternion)
Sets the initial world-space camera position and rotation.
public CutsceneBuilder WithInitialCamera(Vector3 position, Quaternion rotation)
Parameters
positionVector3The initial world-space position.
rotationQuaternionThe initial world-space rotation.
Returns
- CutsceneBuilder
This builder for method chaining.
WithName(string)
Sets the descriptive name used by the native cutscene state.
public CutsceneBuilder WithName(string name)
Parameters
namestringA non-empty descriptive name.
Returns
- CutsceneBuilder
This builder for method chaining.
WithTitleCard(string, float)
Displays a simple centered title card during the start of playback.
public CutsceneBuilder WithTitleCard(string text, float duration = 2)
Parameters
Returns
- CutsceneBuilder
This builder for method chaining.