From 59c7be9e9986fe951707bea70b35a3b73bc7bb96 Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Fri, 15 Apr 2016 14:13:50 +0100 Subject: [PATCH] Added executeMethodName to ExecuteHandler --- .../Fungus/Thirdparty/FungusLua/Scripts/ExecuteHandler.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Assets/Fungus/Thirdparty/FungusLua/Scripts/ExecuteHandler.cs b/Assets/Fungus/Thirdparty/FungusLua/Scripts/ExecuteHandler.cs index adcdb462..876a9042 100644 --- a/Assets/Fungus/Thirdparty/FungusLua/Scripts/ExecuteHandler.cs +++ b/Assets/Fungus/Thirdparty/FungusLua/Scripts/ExecuteHandler.cs @@ -57,6 +57,9 @@ namespace Fungus [SerializeField] public ExecuteMethod executeMethods = ExecuteMethod.Start; + [Tooltip("Name of the method on a component in this gameobject to call when executing.")] + public string executeMethodName = "OnExecute"; + private int m_ExecuteOnFrame; // Recursively build the full hierarchy path to this game object @@ -245,7 +248,10 @@ namespace Fungus public virtual void Execute() { // Call any OnExecute methods in components on this gameobject - SendMessage("OnExecute", SendMessageOptions.DontRequireReceiver); + if (executeMethodName != "") + { + SendMessage(executeMethodName, SendMessageOptions.DontRequireReceiver); + } } #region AssertionComponentConfigurator