Browse Source

Cache the current StandaloneInputModule.

master
Gerardo Marset 9 years ago
parent
commit
6337bf19fd
  1. 10
      Assets/Fungus/Narrative/Scripts/DialogInput.cs

10
Assets/Fungus/Narrative/Scripts/DialogInput.cs

@ -42,6 +42,8 @@ namespace Fungus
protected float ignoreClickTimer; protected float ignoreClickTimer;
protected StandaloneInputModule currentStandaloneInputModule;
/** /**
* Trigger next line input event from script. * Trigger next line input event from script.
*/ */
@ -80,9 +82,11 @@ namespace Fungus
protected virtual void Update() protected virtual void Update()
{ {
StandaloneInputModule currentInputModule = EventSystem.current.GetComponent<StandaloneInputModule>(); if (currentStandaloneInputModule == null)
if (Input.GetButtonDown(currentInputModule.submitButton) || currentStandaloneInputModule = EventSystem.current.GetComponent<StandaloneInputModule>();
(cancelEnabled && Input.GetButton(currentInputModule.cancelButton)))
if (Input.GetButtonDown(currentStandaloneInputModule.submitButton) ||
(cancelEnabled && Input.GetButton(currentStandaloneInputModule.cancelButton)))
{ {
SetNextLineFlag(); SetNextLineFlag();
} }

Loading…
Cancel
Save