private void SetSubtitle() { if (base.GetType() == typeof(EngineAudioSource)) { EngineAudioSource source = this as EngineAudioSource; AudioSourceSubtitle.Instance.Add(source); } }
public void Add(U::UnityEngine.AudioSource source) { try { this.subtitles.Remove(source); this.subtitles.Insert(0, source, new Subtitle(SubtitleUserInterfaceBase <SubtitleCanvas> .Instance.Anchors, source)); } catch (Exception exception) { IniSettings.Error(string.Concat("AudioSourceSubtitle::Load:\n", exception.ToString())); } }
public Subtitle(IEnumerable <TextPosition> anchors, U::UnityEngine.AudioSource source) { this.anchors = anchors; this.content = new Dictionary <TextPosition, StringBuilder>(); this.display = new Dictionary <TextPosition, HashSet <SubtitleLine> >(); foreach (TextPosition position in this.anchors) { this.content.Add(position, new StringBuilder(0x200)); this.display.Add(position, new HashSet <SubtitleLine>()); } this.Source = source; this.Load(); }