Browse Source

Merge pull request #955 from breadnone/DialogInput-ClickAnywhere-fix

Make nextClickDelay works with ClickAnywhere
master
Steve Halliwell 4 years ago
parent
commit
5fefc47788
  1. 1
      Assets/Fungus/Docs/CHANGELOG.txt
  2. 18
      Assets/Fungus/Scripts/Components/DialogInput.cs

1
Assets/Fungus/Docs/CHANGELOG.txt

@ -6,6 +6,7 @@ Unreleased
## Fixed
- Add missing VariableDrawer for ObjectVariable. Thanks to CG-Tespy.
- Fix double duplication of blocks in flowchart window. Thanks to ongjinwen.
- Dialog ClickAnywhere not supports ignore click delay. Thanks to breadnone.
## Changed
- Block will LogError when an exception is caught from a Command being Executed.

18
Assets/Fungus/Scripts/Components/DialogInput.cs

@ -100,7 +100,7 @@ namespace Fungus
case ClickMode.ClickAnywhere:
if (Input.GetMouseButtonDown(0))
{
SetNextLineFlag();
SetClickAnywhereClickedFlag();
}
break;
case ClickMode.ClickOnDialog:
@ -151,7 +151,23 @@ namespace Fungus
{
nextLineInputFlag = true;
}
/// <summary>
/// Set the ClickAnywhere click flag.
/// </summary>
public virtual void SetClickAnywhereClickedFlag()
{
if (ignoreClickTimer > 0f)
{
return;
}
ignoreClickTimer = nextClickDelay;
// Only applies if ClickedAnywhere is selected
if (clickMode == ClickMode.ClickAnywhere)
{
SetNextLineFlag();
}
}
/// <summary>
/// Set the dialog clicked flag (usually from an Event Trigger component in the dialog UI).
/// </summary>

Loading…
Cancel
Save