From ff3306143eeb650ff0886d30f290496a4ee3cd1f Mon Sep 17 00:00:00 2001 From: desktop-maesty/steve Date: Sun, 15 Sep 2019 09:03:21 +1000 Subject: [PATCH] Added warnings when MenuDialog -Menu item requested when there are non left -Timer requested when none is available --- Assets/Fungus/Scripts/Components/MenuDialog.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Assets/Fungus/Scripts/Components/MenuDialog.cs b/Assets/Fungus/Scripts/Components/MenuDialog.cs index 75da12d5..b5329bf3 100644 --- a/Assets/Fungus/Scripts/Components/MenuDialog.cs +++ b/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) { if (nextOptionIndex >= CachedButtons.Length) + { + Debug.LogWarning("Unable to add menu item, not enough buttons: " + text); return false; - + } //if first option notify that a menu has started if(nextOptionIndex == 0) MenuSignals.DoMenuStart(this); @@ -344,6 +346,10 @@ namespace Fungus StopAllCoroutines(); StartCoroutine(WaitForTimeout(duration, targetBlock)); } + else + { + Debug.LogWarning("Unable to show timer, no slider set"); + } } ///