private void ExecuteCurrentTaskHelperWithTimeDelay() { if (index >= Plan.Count) { index = 0; hasPlan = false; // because we finished this plan } else { PrimitiveTask task = Plan[index]; // Debug.Log("Currently executing " + task.ToString()); task.ExecuteTaskAndUpdateWorldState(); index++; Invoke("ExecuteCurrentTaskHelperWithTimeDelay", 1f); } }