diff --git a/Assets/Fungus/FungusScript/Editor/FungusScriptWindow.cs b/Assets/Fungus/FungusScript/Editor/FungusScriptWindow.cs index 3e230f8f..fb1f06c7 100755 --- a/Assets/Fungus/FungusScript/Editor/FungusScriptWindow.cs +++ b/Assets/Fungus/FungusScript/Editor/FungusScriptWindow.cs @@ -386,7 +386,13 @@ namespace Fungus EventHandlerInfoAttribute info = EventHandlerEditor.GetEventHandlerInfo(sequence.eventHandler.GetType()); if (info != null) { - nodeName = "(" + info.EventHandlerName + ")\n"; + string handlerSummary = sequence.eventHandler.GetSummary(); + if (handlerSummary == "") + { + handlerSummary = info.EventHandlerName; + } + + nodeName = "(" + handlerSummary + ")\n"; nodeStyle.padding.top = 23; // Adjust label to fit on two lines } diff --git a/Assets/Fungus/FungusScript/Scripts/EventHandler.cs b/Assets/Fungus/FungusScript/Scripts/EventHandler.cs index 846ab1ee..0b839ebf 100644 --- a/Assets/Fungus/FungusScript/Scripts/EventHandler.cs +++ b/Assets/Fungus/FungusScript/Scripts/EventHandler.cs @@ -48,5 +48,15 @@ namespace Fungus FungusScript fungusScript = parentSequence.GetFungusScript(); return fungusScript.ExecuteSequence(parentSequence); } + + /** + * Returns a custom summary for the event handler. + * If the string is empty, the editor will use the EventHandlerName property of + * the EventHandlerInfo attribute instead. + */ + public virtual string GetSummary() + { + return ""; + } } }