From 04b973191e1c7e3b1e7d63b4c96a0d973b4a21c0 Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Wed, 26 Feb 2014 14:32:32 +0000 Subject: [PATCH] Can click/tap anywhere to continue --- Assets/Fungus/Scripts/Page.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Assets/Fungus/Scripts/Page.cs b/Assets/Fungus/Scripts/Page.cs index 6730f702..4c307f92 100644 --- a/Assets/Fungus/Scripts/Page.cs +++ b/Assets/Fungus/Scripts/Page.cs @@ -197,6 +197,9 @@ namespace Fungus if (finishedWriting) { + // Player can continue through single options by clicking / tapping anywhere + bool quickContinue = (options.Count == 1 && (Input.GetMouseButtonUp(0) || Input.anyKeyDown)); + Rect buttonRect = innerRect; buttonRect.y += titleHeight + storyHeight; foreach (Option option in options) @@ -204,7 +207,8 @@ namespace Fungus GUIContent buttonContent = new GUIContent(option.optionText); buttonRect.height = optionStyle.CalcHeight(buttonContent, innerRect.width); - if (GUI.Button(buttonRect, buttonContent, optionStyle)) + if (quickContinue || + GUI.Button(buttonRect, buttonContent, optionStyle)) { if (option.optionAction != null) {