Browse Source

Merge pull request #301 from FungusGames/clear-menu-command-#300

Added Clear Menu command #300
master
Chris Gregan 9 years ago
parent
commit
d1de5351a1
  1. 38
      Assets/Fungus/Narrative/Scripts/Commands/ClearMenu.cs
  2. 12
      Assets/Fungus/Narrative/Scripts/Commands/ClearMenu.cs.meta
  3. 2
      Assets/Fungus/Narrative/Scripts/MenuDialog.cs

38
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);
}
}
}

12
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:

2
Assets/Fungus/Narrative/Scripts/MenuDialog.cs

@ -66,7 +66,7 @@ namespace Fungus
Canvas.ForceUpdateCanvases();
}
protected virtual void Clear()
public virtual void Clear()
{
StopAllCoroutines();

Loading…
Cancel
Save