diff --git a/Assets/Fungus/Narrative/Scripts/DialogInput.cs b/Assets/Fungus/Narrative/Scripts/DialogInput.cs index d5094b70..872b7dfd 100644 --- a/Assets/Fungus/Narrative/Scripts/DialogInput.cs +++ b/Assets/Fungus/Narrative/Scripts/DialogInput.cs @@ -7,17 +7,9 @@ using UnityEngine.EventSystems; namespace Fungus { /// - /// Interface for listening for dialogue input events. + /// Input handler for say dialogs. /// - public interface IDialogInputListener - { - void OnNextLineEvent(); - } - - /// - /// Input handler for say dialogues. - /// - public class DialogInput : MonoBehaviour + public class DialogInput : MonoBehaviour, IDialogInput { public enum ClickMode { @@ -47,42 +39,6 @@ namespace Fungus protected StandaloneInputModule currentStandaloneInputModule; - /// - /// Trigger next line input event from script. - /// - public void SetNextLineFlag() - { - nextLineInputFlag = true; - } - - /// - /// Set the dialog clicked flag (usually from an Event Trigger component in the dialog UI). - /// - public void SetDialogClickedFlag() - { - // Ignore repeat clicks for a short time to prevent accidentally clicking through the character dialogue - if (ignoreClickTimer > 0f) - { - return; - } - ignoreClickTimer = nextClickDelay; - - // Only applies in Click On Dialog mode - if (clickMode == ClickMode.ClickOnDialog) - { - dialogClickedFlag = true; - } - } - - public void SetButtonClickedFlag() - { - // Only applies if clicking is not disabled - if (clickMode != ClickMode.Disabled) - { - SetNextLineFlag(); - } - } - protected virtual void Update() { if (EventSystem.current == null) @@ -159,5 +115,39 @@ namespace Fungus nextLineInputFlag = false; } } + + #region IDialogInput + + public void SetNextLineFlag() + { + nextLineInputFlag = true; + } + + public void SetDialogClickedFlag() + { + // Ignore repeat clicks for a short time to prevent accidentally clicking through the character dialogue + if (ignoreClickTimer > 0f) + { + return; + } + ignoreClickTimer = nextClickDelay; + + // Only applies in Click On Dialog mode + if (clickMode == ClickMode.ClickOnDialog) + { + dialogClickedFlag = true; + } + } + + public void SetButtonClickedFlag() + { + // Only applies if clicking is not disabled + if (clickMode != ClickMode.Disabled) + { + SetNextLineFlag(); + } + } + + #endregion } } diff --git a/Assets/Fungus/Narrative/Scripts/IDialogInput.cs b/Assets/Fungus/Narrative/Scripts/IDialogInput.cs new file mode 100644 index 00000000..d8676de9 --- /dev/null +++ b/Assets/Fungus/Narrative/Scripts/IDialogInput.cs @@ -0,0 +1,31 @@ +namespace Fungus +{ + /// + /// Input handler for say dialogues. + /// + public interface IDialogInput + { + /// + /// Trigger next line input event from script. + /// + void SetNextLineFlag(); + + /// + /// Set the dialog clicked flag (usually from an Event Trigger component in the dialog UI). + /// + void SetDialogClickedFlag(); + + /// + /// Sets the button clicked flag. + /// + void SetButtonClickedFlag(); + } + + /// + /// Interface for listening for dialogue input events. + /// + public interface IDialogInputListener + { + void OnNextLineEvent(); + } +} \ No newline at end of file diff --git a/Assets/Fungus/Narrative/Scripts/IDialogInput.cs.meta b/Assets/Fungus/Narrative/Scripts/IDialogInput.cs.meta new file mode 100644 index 00000000..6cfe95f6 --- /dev/null +++ b/Assets/Fungus/Narrative/Scripts/IDialogInput.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: daaafdda848514f7caee7d3a2b70a30c +timeCreated: 1473680781 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: