From d34d206ff0963abc77524ead1e0f6e5a4344dd32 Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Fri, 19 Sep 2014 16:08:42 +0100 Subject: [PATCH] Attempt to use any dialog if none currently set --- Assets/Fungus/Dialog/Commands/Choose.cs | 9 +++++++-- Assets/Fungus/Dialog/Commands/Say.cs | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Assets/Fungus/Dialog/Commands/Choose.cs b/Assets/Fungus/Dialog/Commands/Choose.cs index e3f9e74e..37ed8e30 100644 --- a/Assets/Fungus/Dialog/Commands/Choose.cs +++ b/Assets/Fungus/Dialog/Commands/Choose.cs @@ -33,8 +33,13 @@ namespace Fungus showBasicGUI = false; if (dialog == null) { - showBasicGUI = true; - return; + // Try to get any SayDialog in the scene + dialog = GameObject.FindObjectOfType(); + if (dialog == null) + { + showBasicGUI = true; + return; + } } if (options.Count == 0) diff --git a/Assets/Fungus/Dialog/Commands/Say.cs b/Assets/Fungus/Dialog/Commands/Say.cs index c5cb8411..f349bc54 100644 --- a/Assets/Fungus/Dialog/Commands/Say.cs +++ b/Assets/Fungus/Dialog/Commands/Say.cs @@ -33,8 +33,13 @@ namespace Fungus showBasicGUI = false; if (dialog == null) { - showBasicGUI = true; - return; + // Try to get any SayDialog in the scene + dialog = GameObject.FindObjectOfType(); + if (dialog == null) + { + showBasicGUI = true; + return; + } } dialog.SetCharacter(character);