Class Subtitler
[RequireComponent(typeof(UIDocument))]
[HelpURL("https://gasimo.dev/Subtitler/manual/Components/subtitler.html")]
public class Subtitler : MonoSingleton<Subtitler>
- Inheritance
-
objectObjectComponentBehaviourMonoBehaviourSubtitler
- 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
entryISubtitleEntryEntry 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
entryISubtitleEntryEntry containing the subtitle data
audioPlayerIAudioPlayerAudioPlayer 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
entryISubtitleEntryEntry containing the subtitle data
audioSourceAudioSourceAudioSource 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
sequenceDataISubtitleSequenceSequence to be played
audioPlayerIAudioPlayerIAudioPlayer 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
sequenceDataISubtitleSequenceSequence to be played
audioSourceAudioSourceAudioSource 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
idintId 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
secondsdoublecancellationTokenCancellationToken
Returns
- Task
Exceptions
- OperationCanceledException