Browse Source

Attempt to use any dialog if none currently set

master
chrisgregan 11 years ago
parent
commit
d34d206ff0
  1. 5
      Assets/Fungus/Dialog/Commands/Choose.cs
  2. 5
      Assets/Fungus/Dialog/Commands/Say.cs

5
Assets/Fungus/Dialog/Commands/Choose.cs

@ -32,10 +32,15 @@ namespace Fungus
ChooseDialog dialog = SetChooseDialog.activeDialog; ChooseDialog dialog = SetChooseDialog.activeDialog;
showBasicGUI = false; showBasicGUI = false;
if (dialog == null) if (dialog == null)
{
// Try to get any SayDialog in the scene
dialog = GameObject.FindObjectOfType<ChooseDialog>();
if (dialog == null)
{ {
showBasicGUI = true; showBasicGUI = true;
return; return;
} }
}
if (options.Count == 0) if (options.Count == 0)
{ {

5
Assets/Fungus/Dialog/Commands/Say.cs

@ -32,10 +32,15 @@ namespace Fungus
SayDialog dialog = SetSayDialog.activeDialog; SayDialog dialog = SetSayDialog.activeDialog;
showBasicGUI = false; showBasicGUI = false;
if (dialog == null) if (dialog == null)
{
// Try to get any SayDialog in the scene
dialog = GameObject.FindObjectOfType<SayDialog>();
if (dialog == null)
{ {
showBasicGUI = true; showBasicGUI = true;
return; return;
} }
}
dialog.SetCharacter(character); dialog.SetCharacter(character);

Loading…
Cancel
Save