From b4ebe88bb3285b59115984b94110cfb713af4414 Mon Sep 17 00:00:00 2001 From: Christopher Date: Tue, 28 Feb 2017 16:59:16 +0000 Subject: [PATCH] Fixed SayDialog not caching all Substitution Handlers when enabled #599 --- Assets/Fungus/Scripts/Components/SayDialog.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Assets/Fungus/Scripts/Components/SayDialog.cs b/Assets/Fungus/Scripts/Components/SayDialog.cs index a23acc13..a3b15475 100644 --- a/Assets/Fungus/Scripts/Components/SayDialog.cs +++ b/Assets/Fungus/Scripts/Components/SayDialog.cs @@ -147,10 +147,16 @@ namespace Fungus // Character image is hidden by default. SetCharacterImage(null); } + } + protected void OnEnable() + { + // We need to update the cached list every time the Say Dialog is enabled + // due to an initialization order issue after loading scenes. stringSubstituter.CacheSubstitutionHandlers(); } + protected virtual void LateUpdate() { UpdateAlpha();