From b0a7ed58586088604053faede96e107a85a3a68f Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Sat, 17 Jan 2015 23:13:40 +0000 Subject: [PATCH] Fix #73 Switching dialogs on click causes text to skip Ignore any previous click when a dialog is made visible. --- Assets/Fungus/Dialog/Scripts/Dialog.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Assets/Fungus/Dialog/Scripts/Dialog.cs b/Assets/Fungus/Dialog/Scripts/Dialog.cs index 209b2f6d..2eba086b 100644 --- a/Assets/Fungus/Dialog/Scripts/Dialog.cs +++ b/Assets/Fungus/Dialog/Scripts/Dialog.cs @@ -61,6 +61,14 @@ namespace Fungus { dialogCanvas.gameObject.SetActive(visible); } + + if (visible) + { + // A new dialog is often shown as the result of a mouse click, so we need + // to make sure the previous click doesn't register on the new dialogue + wasPointerClicked = false; + clickCooldownTimer = 0.2f; + } } public virtual void SetCharacter(Character character, FungusScript fungusScript = null)