diff --git a/Assets/Splatter/Scripts/Runtime/AI/BehaviourTree/BehaviourTree.cs b/Assets/Splatter/Scripts/Runtime/AI/BehaviourTree/BehaviourTree.cs index b864a2a..4a9f5b9 100644 --- a/Assets/Splatter/Scripts/Runtime/AI/BehaviourTree/BehaviourTree.cs +++ b/Assets/Splatter/Scripts/Runtime/AI/BehaviourTree/BehaviourTree.cs @@ -19,9 +19,12 @@ public abstract class BehaviourTree : MonoBehaviour { /// public int Ticks { get; private set; } - public virtual void Start() { + protected virtual void Awake() { Blackboard = new Dictionary(); Ticks = 0; + } + + protected virtual void Start() { root = CreateRoot(); } diff --git a/Assets/Splatter/Scripts/Runtime/AI/BehaviourTree/BehaviourTreeBuilder.cs b/Assets/Splatter/Scripts/Runtime/AI/BehaviourTree/BehaviourTreeBuilder.cs index 28b1ba6..1cb1698 100644 --- a/Assets/Splatter/Scripts/Runtime/AI/BehaviourTree/BehaviourTreeBuilder.cs +++ b/Assets/Splatter/Scripts/Runtime/AI/BehaviourTree/BehaviourTreeBuilder.cs @@ -7,11 +7,11 @@ namespace Splatter.AI.BehaviourTree { /// Helper for creating behaviour tree /// public class BehaviourTreeBuilder { - public BehaviourTree Tree { get; private set; } - private Node currentNode; private Stack stack; + public BehaviourTree Tree { get; private set; } + /// /// Initializes a new instance of the class. /// diff --git a/Assets/Splatter/Scripts/Runtime/AI/BehaviourTree/WaitUntilNode.cs.meta b/Assets/Splatter/Scripts/Runtime/AI/BehaviourTree/WaitUntilNode.cs.meta new file mode 100644 index 0000000..28cd058 --- /dev/null +++ b/Assets/Splatter/Scripts/Runtime/AI/BehaviourTree/WaitUntilNode.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 35ca8c4c4bb6ca74bb9105ec185523cd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: