Skip to content

Commit f27713d

Browse files
committed
Add test script for nested BehaviorTree field.
1 parent e5029cb commit f27713d

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

Assets/Samples/BehaviorTreeList.cs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using CleverCrow.Fluid.BTs.Trees;
2+
using System;
23
using System.Collections.Generic;
34
using UnityEngine;
45

@@ -10,12 +11,20 @@ protected void Awake()
1011
{
1112
for (int i = 0; i < 3; i++)
1213
{
13-
trees.Add(new BehaviorTreeBuilder(gameObject).Name($"Tree{i}").Sequence()
14-
.WaitTime(1)
15-
.ReturnSuccess()
16-
.End().Build());
14+
trees.Add(new NestedTree()
15+
{
16+
tree = new BehaviorTreeBuilder(gameObject).Name($"Tree{i}").Sequence()
17+
.WaitTime(1)
18+
.ReturnSuccess()
19+
.End().Build()
20+
});
1721
}
1822
}
19-
public List<BehaviorTree> trees = new List<BehaviorTree>();
23+
public List<NestedTree> trees = new List<NestedTree>();
24+
}
25+
[Serializable]
26+
public class NestedTree
27+
{
28+
public BehaviorTree tree;
2029
}
2130
}

0 commit comments

Comments
 (0)