Added: Unity Behavior Graph asset for behaviour demo

This commit is contained in:
2026-11-12 18:54:45 +01:00
parent a9a29ac7c8
commit 7bd50affc9
32 changed files with 4163 additions and 7 deletions
@@ -0,0 +1,30 @@
using UnityEngine;
namespace AI.BehaviourTree
{
public class BehaviourTree : MonoBehaviour
{
private Node rootNode;
private void OnEnable()
{
NodeStatus status = rootNode.Start();
Debug.Log("Behaviour tree started");
Debug.Log($"Behaviour tree start root node status: {status}");
if (status != NodeStatus.Running) enabled = false;
}
private void OnDisable()
{
Debug.Log("Behaviour tree stopped");
rootNode.Stop();
}
private void Update()
{
NodeStatus status = rootNode.Execute();
Debug.Log($"Behaviour tree execute root node status: {status}");
if (status != NodeStatus.Running) enabled = false;
}
}
}