summaryrefslogtreecommitdiff
path: root/Client/Assets/Behavior Designer/Runtime/Actions/StartBehaviorTree.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Client/Assets/Behavior Designer/Runtime/Actions/StartBehaviorTree.cs')
-rw-r--r--Client/Assets/Behavior Designer/Runtime/Actions/StartBehaviorTree.cs6
1 files changed, 4 insertions, 2 deletions
diff --git a/Client/Assets/Behavior Designer/Runtime/Actions/StartBehaviorTree.cs b/Client/Assets/Behavior Designer/Runtime/Actions/StartBehaviorTree.cs
index e817713a..214644fb 100644
--- a/Client/Assets/Behavior Designer/Runtime/Actions/StartBehaviorTree.cs
+++ b/Client/Assets/Behavior Designer/Runtime/Actions/StartBehaviorTree.cs
@@ -39,8 +39,10 @@ namespace BehaviorDesigner.Runtime.Tasks
if (behavior != null) {
var variables = Owner.GetAllVariables();
- for (int i = 0; i < variables.Count; ++i) {
- behavior.SetVariable(variables[i].Name, variables[i]);
+ if (variables != null && synchronizeVariables.Value) {
+ for (int i = 0; i < variables.Count; ++i) {
+ behavior.SetVariable(variables[i].Name, variables[i]);
+ }
}
behavior.EnableBehavior();