Browse Source

Fixed concurrent Say commands on same Say Dialog should interrupt #356

master
chrisgregan 9 years ago
parent
commit
382787a601
  1. 9
      Assets/Fungus/Narrative/Scripts/SayDialog.cs
  2. 2478
      Assets/Tests/Narrative/NarrativeTests.unity

9
Assets/Fungus/Narrative/Scripts/SayDialog.cs

@ -135,12 +135,13 @@ namespace Fungus
{ {
Writer writer = GetWriter(); Writer writer = GetWriter();
// Stop any existing Say Command and write this one instead if (writer.isWriting || writer.isWaitingForInput)
// This will probably take a frame or two to complete
while (writer.isWriting || writer.isWaitingForInput)
{ {
writer.Stop(); writer.Stop();
yield return null; while (writer.isWriting || writer.isWaitingForInput)
{
yield return null;
}
} }
this.fadeWhenDone = fadeWhenDone; this.fadeWhenDone = fadeWhenDone;

2478
Assets/Tests/Narrative/NarrativeTests.unity

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save