Class UnityCutscenePlayerService
Unity cutscene player service providing cutscene-specific playback API.
Executes timed stages directly using ITimedSequenceStage.DurationSeconds.
CutscenePlayer is a first-class vertical aggregate, NOT legacy.
It provides cutscene authoring, tooling, and UX on top of the generic
SequencePlayer orchestration foundation.
NOTE: This service does NOT delegate to UnitySequencePlayerService.
It executes stages directly because CutscenePlayer owns timed orchestration.
RigPrefab is owned by CutscenePlayer, NOT by generic SequencePlayer.
Bounded-wait contract (Slice W): every wait path in this service has a hard
upper bound enforced via either Delay(TimeSpan, CancellationToken)
against a sanitized duration, or a wall-clock-driven loop against
UnityEngine.Time.realtimeSinceStartup. No code path waits for a Unity callback
(UnityEngine.Playables.PlayableDirector.stopped, UnityEngine.Time.unscaledDeltaTime tick) without
also racing it against a finite timeout. This is required for WebGL where
PlayableDirector.stopped may not fire reliably for some timeline shapes,
AudioContext suspension can stall the main update loop, and a hung cutscene
would otherwise block the entire initialization pipeline indefinitely.
Inheritance
UnityCutscenePlayerService
Assembly: Serenity.UnityCutscenePlayer.Infrastructure.dll
Syntax
public class UnityCutscenePlayerService : MonoBehaviour, ICutscenePlayerService, ISequencePlayerService, IService, IFoundationSettings
Constructors
UnityCutscenePlayerService()
Declaration
public UnityCutscenePlayerService()
Properties
Guid
Declaration
public string Guid { get; set; }
Property Value
Id
Declaration
public string Id { get; set; }
Property Value
LogService
Declaration
public ILogService LogService { get; set; }
Property Value
Methods
Initialize(ILogService)
Initializes the cutscene player service with logging dependency.
Declaration
public void Initialize(ILogService logService)
Parameters
PlayAsync(ISequenceDefinition, CancellationToken)
Plays a cutscene asynchronously using a cutscene definition.
Declaration
public Task PlayAsync(ISequenceDefinition definition, CancellationToken cancellationToken = default)
Parameters
Returns
PlayAsync(string, CancellationToken)
Plays a cutscene asynchronously by key identifier.
Declaration
public Task PlayAsync(string cutsceneKey, CancellationToken cancellationToken = default)
Parameters
Returns
SetDefinitions(UnityCutsceneDefinition[])
Sets cutscene definitions array.
Declaration
public void SetDefinitions(UnityCutsceneDefinition[] defs)
Parameters
Implements