Table of Contents

Class Subtitler

Namespace
Gasimo.Subtitles
Assembly
Gasimo.Subtitler.dll
[RequireComponent(typeof(UIDocument))]
[HelpURL("https://gasimo.dev/Subtitler/manual/Components/subtitler.html")]
public class Subtitler : MonoSingleton<Subtitler>
Inheritance
object
Object
Component
Behaviour
MonoBehaviour
Subtitler
Inherited Members

Fields

siteURL

public const string siteURL = "https://gasimo.dev/Subtitler/"

Field Value

string

Methods

Awake()

Use this for initialization.

protected override void Awake()

PlaySubtitleEntry(ISubtitleEntry)

Plays a single line of subtitles

public int PlaySubtitleEntry(ISubtitleEntry entry)

Parameters

entry ISubtitleEntry

Entry containing the subtitle data

Returns

int

Id of the session instance

PlaySubtitleEntry(ISubtitleEntry, IAudioPlayer)

Plays a single line of subtitles on a given AudioPlayer

public int PlaySubtitleEntry(ISubtitleEntry entry, IAudioPlayer audioPlayer)

Parameters

entry ISubtitleEntry

Entry containing the subtitle data

audioPlayer IAudioPlayer

AudioPlayer to play through

Returns

int

Id of the session instance

PlaySubtitleEntry(ISubtitleEntry, AudioSource)

Plays a single line of subtitles on a given AudioSource

public int PlaySubtitleEntry(ISubtitleEntry entry, AudioSource audioSource)

Parameters

entry ISubtitleEntry

Entry containing the subtitle data

audioSource AudioSource

AudioSource to play through

Returns

int

Id of the session instance

PlaySubtitleSequence(ISubtitleSequence, IAudioPlayer)

Plays a sequence of SubtitleEntries on a given IAudioPlayer

public int PlaySubtitleSequence(ISubtitleSequence sequenceData, IAudioPlayer audioPlayer)

Parameters

sequenceData ISubtitleSequence

Sequence to be played

audioPlayer IAudioPlayer

IAudioPlayer to play through

Returns

int

Id of the session instance

PlaySubtitleSequence(ISubtitleSequence, AudioSource)

Plays a sequence of SubtitleEntries on a given AudioSource

public int PlaySubtitleSequence(ISubtitleSequence sequenceData, AudioSource audioSource)

Parameters

sequenceData ISubtitleSequence

Sequence to be played

audioSource AudioSource

AudioSource to play through

Returns

int

Id of the session instance

RemoveOldest()

Removes and hides a active Subtitle Session with the oldest id.

public void RemoveOldest()

RemoveSubtitle(int)

Removes and hides a Subtitle session immediately.

public void RemoveSubtitle(int id)

Parameters

id int

Id of the session to hide

Update()

public void Update()

WaitForGameTime(double, CancellationToken)

Waits for a specified amount of game time. Used by Subtitler (and optionally transition modules) to wait for a specific amount of time.

public static Task WaitForGameTime(double seconds, CancellationToken cancellationToken)

Parameters

seconds double
cancellationToken CancellationToken

Returns

Task

Exceptions

OperationCanceledException