2024-04-28 13:55:19 +00:00
|
|
|
|
namespace ColdMint.scripts.behaviorTree;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// <para>BehaviorTreeTemplate</para>
|
|
|
|
|
/// <para>行为树模板</para>
|
|
|
|
|
/// </summary>
|
|
|
|
|
public abstract class BehaviorTreeTemplate : IBehaviorTree
|
|
|
|
|
{
|
2024-05-08 10:22:04 +00:00
|
|
|
|
private IBehaviorTreeNode? _root;
|
|
|
|
|
private string? _id;
|
|
|
|
|
public IBehaviorTreeNode? Root => _root;
|
|
|
|
|
public string? Id => _id;
|
2024-04-28 13:55:19 +00:00
|
|
|
|
|
|
|
|
|
public void Init()
|
|
|
|
|
{
|
|
|
|
|
_root = CreateRoot();
|
2024-05-08 10:22:04 +00:00
|
|
|
|
_id = CreateId();
|
2024-04-28 13:55:19 +00:00
|
|
|
|
}
|
|
|
|
|
|
2024-05-08 10:22:04 +00:00
|
|
|
|
protected abstract IBehaviorTreeNode? CreateRoot();
|
2024-04-28 13:55:19 +00:00
|
|
|
|
|
2024-05-08 10:22:04 +00:00
|
|
|
|
protected abstract string? CreateId();
|
2024-04-28 13:55:19 +00:00
|
|
|
|
}
|