diff --git a/Assets/Fungus/Narrative/Scripts/DialogInput.cs b/Assets/Fungus/Narrative/Scripts/DialogInput.cs index dd2412bc..0f85bef3 100644 --- a/Assets/Fungus/Narrative/Scripts/DialogInput.cs +++ b/Assets/Fungus/Narrative/Scripts/DialogInput.cs @@ -42,6 +42,8 @@ namespace Fungus protected float ignoreClickTimer; + protected StandaloneInputModule currentStandaloneInputModule; + /** * Trigger next line input event from script. */ @@ -80,9 +82,11 @@ namespace Fungus protected virtual void Update() { - StandaloneInputModule currentInputModule = EventSystem.current.GetComponent(); - if (Input.GetButtonDown(currentInputModule.submitButton) || - (cancelEnabled && Input.GetButton(currentInputModule.cancelButton))) + if (currentStandaloneInputModule == null) + currentStandaloneInputModule = EventSystem.current.GetComponent(); + + if (Input.GetButtonDown(currentStandaloneInputModule.submitButton) || + (cancelEnabled && Input.GetButton(currentStandaloneInputModule.cancelButton))) { SetNextLineFlag(); }