Skip to content

Commit

Permalink
Move blackboard initilisation to awake method
Browse files Browse the repository at this point in the history
  • Loading branch information
ormesam committed Jan 18, 2022
1 parent 794cda9 commit 33cc7e5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ public abstract class BehaviourTree : MonoBehaviour {
/// </summary>
public int Ticks { get; private set; }

public virtual void Start() {
protected virtual void Awake() {
Blackboard = new Dictionary<string, object>();
Ticks = 0;
}

protected virtual void Start() {
root = CreateRoot();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ namespace Splatter.AI.BehaviourTree {
/// Helper for creating behaviour tree
/// </summary>
public class BehaviourTreeBuilder {
public BehaviourTree Tree { get; private set; }

private Node currentNode;
private Stack<Node> stack;

public BehaviourTree Tree { get; private set; }

/// <summary>
/// Initializes a new instance of the <see cref="BehaviourTreeBuilder"/> class.
/// </summary>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 33cc7e5

Please sign in to comment.