From 34b269bd0f17f4091908556e4bf62eeccd917a1c Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Thu, 20 Aug 2015 11:30:29 +0100 Subject: [PATCH] Removed delay property from Invoke Method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Invoke Method supports calling coroutine functions with the option to stop or wait until the coroutine exits before continuing with the next command. This conflicts with the concept of delaying invocation of the method until later and continuing immediately. Rather than have a hard to understand interaction it’s better to just let users add a Wait command before Invoke Command when they want to introduce a delay. --- .../Flowchart/Scripts/Commands/InvokeMethod.cs | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/Assets/Fungus/Flowchart/Scripts/Commands/InvokeMethod.cs b/Assets/Fungus/Flowchart/Scripts/Commands/InvokeMethod.cs index 8934aeef..13a36a54 100755 --- a/Assets/Fungus/Flowchart/Scripts/Commands/InvokeMethod.cs +++ b/Assets/Fungus/Flowchart/Scripts/Commands/InvokeMethod.cs @@ -14,9 +14,6 @@ namespace Fungus "Invokes a method of a component via reflection. Supports passing multiple parameters and storing returned values in a Fungus variable.")] public class InvokeMethod : Command { - [Tooltip("Delay before invoking method")] - public float delay; - [Tooltip("GameObject containing the component method to be invoked")] public GameObject targetObject; @@ -94,18 +91,6 @@ namespace Fungus public override void OnEnter() { - if (delay <= 0) - { - DoInvokeMethod(); - } - else - { - Invoke("DoInvokeMethod", delay); - } - } - - protected virtual void DoInvokeMethod() - { try { if (targetObject == null || string.IsNullOrEmpty(targetComponentAssemblyName) || string.IsNullOrEmpty(targetMethod)) @@ -129,7 +114,7 @@ namespace Fungus { StartCoroutine(ExecuteCoroutine()); - if(callMode == Call.CallMode.Continue) + if (callMode == Call.CallMode.Continue) { Continue(); }