Skip to content

Commit

Permalink
Can click/tap anywhere to continue
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgregan committed Feb 26, 2014
1 parent 6d5a58a commit 04b9731
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Assets/Fungus/Scripts/Page.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,14 +197,18 @@ public virtual void OnGUI()

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)
{
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)
{
Expand Down

0 comments on commit 04b9731

Please sign in to comment.