Files
david d9fb5ee7bc add unity behavior tree package & examples
add start of own implementation of a behavior tree
2025-04-23 12:33:28 +02:00

28 lines
538 B
C#

using System;
using UnityEngine;
namespace DefaultNamespace.BehaviorTree
{
public class Tree : MonoBehaviour
{
private Node _rootNode;
private void OnEnable()
{
if (_rootNode == null) return;
_rootNode.Start();
}
private void Update()
{
if (_rootNode == null) return;
_rootNode.Update();
}
private void OnDisable()
{
if (_rootNode == null) return;
_rootNode.End();
}
}
}