add unity behavior tree package & examples
add start of own implementation of a behavior tree
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user