add unity behavior package & examples
add behavior tree implementation
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace DefaultNamespace.BehaviorTree
|
||||
{
|
||||
public class Tree : MonoBehaviour
|
||||
{
|
||||
private Node _rootNode;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
_rootNode?.Start();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
_rootNode?.Update();
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
_rootNode?.End();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user