Commit ae9a15094dba8528baccec025f191c611a3a4e28
1 parent
69eacbe1
Exists in
devel
Fix subtitles synchronizer starting
Showing
1 changed file
with
11 additions
and
1 deletions
Show diff stats
Assets/Scripts/PlayerManager/GenericPlayerManager.cs
@@ -486,7 +486,13 @@ public abstract class GenericPlayerManager : MonoBehaviour { | @@ -486,7 +486,13 @@ public abstract class GenericPlayerManager : MonoBehaviour { | ||
486 | string lastAnimationSubtitle = ""; | 486 | string lastAnimationSubtitle = ""; |
487 | bool spelled = false; | 487 | bool spelled = false; |
488 | 488 | ||
489 | - StartCoroutine(subtitlesSynchronizer); | 489 | + Debug.Log("GPM.LAP(" + gloss + "): Starting subtitlesSynchronizer"); |
490 | + | ||
491 | + if (this.subtitlesSynchronizer == null) | ||
492 | + this.subtitlesSynchronizer = SubtitlesSynchronizer(); | ||
493 | + | ||
494 | + StartCoroutine(this.subtitlesSynchronizer); | ||
495 | + yield return null; | ||
490 | 496 | ||
491 | string[] stringPos = gloss.Split(' '); | 497 | string[] stringPos = gloss.Split(' '); |
492 | 498 | ||
@@ -595,6 +601,8 @@ public abstract class GenericPlayerManager : MonoBehaviour { | @@ -595,6 +601,8 @@ public abstract class GenericPlayerManager : MonoBehaviour { | ||
595 | if (toPlayQueue.Count > 4 || wordsCount == stringPos.Length) | 601 | if (toPlayQueue.Count > 4 || wordsCount == stringPos.Length) |
596 | while (toPlayQueue.Count > 0) | 602 | while (toPlayQueue.Count > 0) |
597 | toPlayQueue.Dequeue().play(this); | 603 | toPlayQueue.Dequeue().play(this); |
604 | + | ||
605 | + yield return null; | ||
598 | } | 606 | } |
599 | 607 | ||
600 | // Default | 608 | // Default |
@@ -694,6 +702,8 @@ public abstract class GenericPlayerManager : MonoBehaviour { | @@ -694,6 +702,8 @@ public abstract class GenericPlayerManager : MonoBehaviour { | ||
694 | 702 | ||
695 | resetStates(); | 703 | resetStates(); |
696 | this.randomAnimations.unlockFor("GPM.SubtitlesSynchronizer"); | 704 | this.randomAnimations.unlockFor("GPM.SubtitlesSynchronizer"); |
705 | + | ||
706 | + this.subtitlesSynchronizer = null; | ||
697 | } | 707 | } |
698 | 708 | ||
699 | public void resetStates() | 709 | public void resetStates() |