private IEnumerator LoopThroughSubtitleLines() { var lines = _subtitleText.Trim().Split('\n'); var duration = new WaitForSecondsRealtime(_durationPerLine); _subtitleRenderer.Show(); foreach (var line in lines) { _subtitleRenderer.SetText(line); yield return(duration); } _subtitleRenderer.Hide(); }
protected virtual void OnDisable() { _subtitleRenderer.Hide(); }