Browse Source

Reverted IEventHandler interface

master
Christopher 9 years ago
parent
commit
ddd3021b3c
  1. 13
      Assets/Fungus/Scripts/Components/EventHandler.cs
  2. 31
      Assets/Fungus/Scripts/Interfaces/IEventHandler.cs
  3. 12
      Assets/Fungus/Scripts/Interfaces/IEventHandler.cs.meta

13
Assets/Fungus/Scripts/Components/EventHandler.cs

@ -35,16 +35,22 @@ namespace Fungus
[RequireComponent(typeof(Block))]
[RequireComponent(typeof(Flowchart))]
[AddComponentMenu("")]
public class EventHandler : MonoBehaviour, IEventHandler
public class EventHandler : MonoBehaviour
{
[HideInInspector]
[FormerlySerializedAs("parentSequence")]
[SerializeField] protected Block parentBlock;
#region IEventHandler
#region Public methods
/// <summary>
/// The parent Block which owns this Event Handler.
/// </summary>
public virtual Block ParentBlock { get { return parentBlock; } set { parentBlock = value; } }
/// <summary>
/// The Event Handler should call this method when the event is detected to start executing the Block.
/// </summary>
public virtual bool ExecuteBlock()
{
if (ParentBlock == null)
@ -68,6 +74,9 @@ namespace Fungus
return flowchart.ExecuteBlock(ParentBlock);
}
/// <summary>
/// Returns custom summary text for the event handler.
/// </summary>
public virtual string GetSummary()
{
return "";

31
Assets/Fungus/Scripts/Interfaces/IEventHandler.cs

@ -1,31 +0,0 @@
// This code is part of the Fungus library (http://fungusgames.com) maintained by Chris Gregan (http://twitter.com/gofungus).
// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE)
namespace Fungus
{
/// <summary>
/// A Block may have an associated Event Handler which starts executing commands when
/// a specific event occurs.
/// To create a custom Event Handler, simply subclass EventHandler and call the ExecuteBlock() method
/// when the event occurs.
/// Add an EventHandlerInfo attibute and your new EventHandler class will automatically appear in the
/// 'Execute On Event' dropdown menu when a block is selected.
/// </summary>
public interface IEventHandler
{
/// <summary>
/// The parent Block which owns this Event Handler.
/// </summary>
Block ParentBlock { get; set; }
/// <summary>
/// The Event Handler should call this method when the event is detected to start executing the Block.
/// </summary>
bool ExecuteBlock();
/// <summary>
/// Returns custom summary text for the event handler.
/// </summary>
string GetSummary();
}
}

12
Assets/Fungus/Scripts/Interfaces/IEventHandler.cs.meta

@ -1,12 +0,0 @@
fileFormatVersion: 2
guid: 5ae3dddb3147c4a07a851843721affe8
timeCreated: 1473856414
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Loading…
Cancel
Save