Browse Source

Merge pull request #755 from stevehalliwell/MenuWarnings

Added warnings when MenuDialog
master
Steve Halliwell 5 years ago committed by GitHub
parent
commit
b086c5417e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      Assets/Fungus/Scripts/Components/MenuDialog.cs

8
Assets/Fungus/Scripts/Components/MenuDialog.cs

@ -294,8 +294,10 @@ namespace Fungus
private bool AddOption(string text, bool interactable, bool hideOption, UnityEngine.Events.UnityAction action) private bool AddOption(string text, bool interactable, bool hideOption, UnityEngine.Events.UnityAction action)
{ {
if (nextOptionIndex >= CachedButtons.Length) if (nextOptionIndex >= CachedButtons.Length)
{
Debug.LogWarning("Unable to add menu item, not enough buttons: " + text);
return false; return false;
}
//if first option notify that a menu has started //if first option notify that a menu has started
if(nextOptionIndex == 0) if(nextOptionIndex == 0)
MenuSignals.DoMenuStart(this); MenuSignals.DoMenuStart(this);
@ -344,6 +346,10 @@ namespace Fungus
StopAllCoroutines(); StopAllCoroutines();
StartCoroutine(WaitForTimeout(duration, targetBlock)); StartCoroutine(WaitForTimeout(duration, targetBlock));
} }
else
{
Debug.LogWarning("Unable to show timer, no slider set");
}
} }
/// <summary> /// <summary>

Loading…
Cancel
Save