Browse Source

Option to Close Other Say Dialogs when one Say Dialog becomes active.

master
Christopher 8 years ago
parent
commit
d52fe2ef11
  1. 14
      Assets/Fungus/Scripts/Components/SayDialog.cs
  2. 2337
      Assets/Tests/Narrative/NarrativeTests.unity

14
Assets/Fungus/Scripts/Components/SayDialog.cs

@ -37,6 +37,9 @@ namespace Fungus
[Tooltip("Adjust width of story text when Character Image is displayed (to avoid overlapping)")] [Tooltip("Adjust width of story text when Character Image is displayed (to avoid overlapping)")]
[SerializeField] protected bool fitTextWithImage = true; [SerializeField] protected bool fitTextWithImage = true;
[Tooltip("Close any other open Say Dialogs when this one is active")]
[SerializeField] protected bool closeOtherDialogs;
protected float startStoryTextWidth; protected float startStoryTextWidth;
protected float startStoryTextInset; protected float startStoryTextInset;
@ -452,6 +455,17 @@ namespace Fungus
} }
} }
if (closeOtherDialogs)
{
for (int i = 0; i < activeSayDialogs.Count; i++)
{
var sd = activeSayDialogs[i];
if (sd.gameObject != gameObject)
{
sd.SetActive(false);
}
}
}
gameObject.SetActive(true); gameObject.SetActive(true);
this.fadeWhenDone = fadeWhenDone; this.fadeWhenDone = fadeWhenDone;

2337
Assets/Tests/Narrative/NarrativeTests.unity

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