diff --git a/Assets/Fungus/Narrative/Scripts/Commands/ClearMenu.cs b/Assets/Fungus/Narrative/Scripts/Commands/ClearMenu.cs new file mode 100644 index 00000000..4eb2e005 --- /dev/null +++ b/Assets/Fungus/Narrative/Scripts/Commands/ClearMenu.cs @@ -0,0 +1,38 @@ +using UnityEngine; +using System.Collections; + +namespace Fungus +{ + + [CommandInfo("Narrative", + "Clear Menu", + "Clears the options from a menu dialogue")] + public class ClearMenu : Command + { + [Tooltip("Menu Dialog to clear the options on")] + public MenuDialog menuDialog; + + public override void OnEnter() + { + menuDialog.Clear(); + + Continue(); + } + + public override string GetSummary() + { + if (menuDialog == null) + { + return "Error: No menu dialog object selected"; + } + + return menuDialog.name; + } + + public override Color GetButtonColor() + { + return new Color32(184, 210, 235, 255); + } + } + +} \ No newline at end of file diff --git a/Assets/Fungus/Narrative/Scripts/Commands/ClearMenu.cs.meta b/Assets/Fungus/Narrative/Scripts/Commands/ClearMenu.cs.meta new file mode 100644 index 00000000..e745bb20 --- /dev/null +++ b/Assets/Fungus/Narrative/Scripts/Commands/ClearMenu.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 430ab3c61eef444b2aec02aee7f809bf +timeCreated: 1445258294 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Fungus/Narrative/Scripts/MenuDialog.cs b/Assets/Fungus/Narrative/Scripts/MenuDialog.cs index 72845632..7eeb55bd 100644 --- a/Assets/Fungus/Narrative/Scripts/MenuDialog.cs +++ b/Assets/Fungus/Narrative/Scripts/MenuDialog.cs @@ -66,7 +66,7 @@ namespace Fungus Canvas.ForceUpdateCanvases(); } - protected virtual void Clear() + public virtual void Clear() { StopAllCoroutines();