Interface ICutscenePlayerService
Specialized service for playing cutscenes.
This interface exists to provide domain semantics on top of the generic ISequencePlayerService. While cutscenes are internally implemented as sequences, exposing a dedicated interface improves readability and dependency clarity in gameplay systems.
Namespace: Serenity.CutscenePlayer.Application.Interfaces
Assembly: Serenity.CutscenePlayer.Application.dll
Syntax
public interface ICutscenePlayerService : ISequencePlayerService, IService, IFoundationSettings
Methods
IsPlaying(string)
True while cutsceneKey is looping (started and not yet stopped).
Declaration
bool IsPlaying(string cutsceneKey)
Parameters
| Type | Name | Description |
|---|---|---|
| string | cutsceneKey |
Returns
| Type | Description |
|---|---|
| bool |
PlayLoopingAsync(string, CancellationToken)
Plays a cutscene as a persistent, looping background sequence and returns immediately.
Idempotent: calling it again with a cutsceneKey that is already looping
is a no-op (no second rig is spawned). Unlike
PlayAsync(string, CancellationToken), this bypasses the
bounded staged pipeline and its hard timeouts — the cutscene loops until Stop(string) is
called. Intended for menu/idle background cutscenes re-triggered on every state transition.
Declaration
Task PlayLoopingAsync(string cutsceneKey, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | cutsceneKey | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
Stop(string)
Stops and tears down a looping cutscene started by PlayLoopingAsync(string, CancellationToken).
Idempotent: a no-op when cutsceneKey is not currently looping.
Declaration
void Stop(string cutsceneKey)
Parameters
| Type | Name | Description |
|---|---|---|
| string | cutsceneKey |