Browse Source

Can click/tap anywhere to continue

master
chrisgregan 11 years ago
parent
commit
04b973191e
  1. 6
      Assets/Fungus/Scripts/Page.cs

6
Assets/Fungus/Scripts/Page.cs

@ -197,6 +197,9 @@ namespace Fungus
if (finishedWriting) 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; Rect buttonRect = innerRect;
buttonRect.y += titleHeight + storyHeight; buttonRect.y += titleHeight + storyHeight;
foreach (Option option in options) foreach (Option option in options)
@ -204,7 +207,8 @@ namespace Fungus
GUIContent buttonContent = new GUIContent(option.optionText); GUIContent buttonContent = new GUIContent(option.optionText);
buttonRect.height = optionStyle.CalcHeight(buttonContent, innerRect.width); buttonRect.height = optionStyle.CalcHeight(buttonContent, innerRect.width);
if (GUI.Button(buttonRect, buttonContent, optionStyle)) if (quickContinue ||
GUI.Button(buttonRect, buttonContent, optionStyle))
{ {
if (option.optionAction != null) if (option.optionAction != null)
{ {

Loading…
Cancel
Save