mirror of
http://47.107.252.169:3000/Roguelite-Game-Developing-Team/Gen_Hack-and-Slash-Roguelite.git
synced 2025-11-20 09:47:13 +08:00
38 lines
855 B
C#
38 lines
855 B
C#
|
|
using Data;
|
||
|
|
using Parsing;
|
||
|
|
using System;
|
||
|
|
using System.Collections.Generic;
|
||
|
|
using Managers;
|
||
|
|
using UnityEngine;
|
||
|
|
|
||
|
|
namespace AI
|
||
|
|
{
|
||
|
|
public enum Status
|
||
|
|
{
|
||
|
|
Ready,
|
||
|
|
Running, // 节点正在执行中
|
||
|
|
Success, // 节点成功完成
|
||
|
|
Failure // 节点失败
|
||
|
|
}
|
||
|
|
public abstract class BehaviorTreeBase
|
||
|
|
{
|
||
|
|
// 所有行为树节点通用的核心成员
|
||
|
|
public Status CurrentStatus = Status.Ready;
|
||
|
|
public Entity.Entity SelfEntity { get; private set; }
|
||
|
|
|
||
|
|
public virtual void Init(BehaviorTreeDef def, Entity.Entity selfEntity)
|
||
|
|
{
|
||
|
|
SelfEntity = selfEntity;
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
// 所有行为树节点都必须实现的执行逻辑
|
||
|
|
public abstract Status Tick();
|
||
|
|
public virtual void Reset()
|
||
|
|
{
|
||
|
|
CurrentStatus = Status.Ready;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|