/// <summary> /// 结束行为创建 /// </summary> /// <returns></returns> public YuAIBehaviorTree End() { while (behaviorNodes.Count > 0) { behaviorNodes.Pop(); } YuAIBehaviorTree tree = new YuAIBehaviorTree(rootBehavior); //初始化行为树创建器 unitEntity = null; rootBehavior = null; return(tree); }
public abstract void OnFixedUpdate(UnitEntityBase role);
public abstract void Exit(UnitEntityBase role);
public abstract void Execute(UnitEntityBase role, object param);
public abstract void Enter(UnitEntityBase role, double duration, object param);
public override void OnFixedUpdate(UnitEntityBase role) { }
/// <summary> /// 设置AI的主体,一直持续到End() /// </summary> /// <param name="role"></param> public void SetAISubject(UnitEntityBase role) { unitEntity = role; }
public override void Exit(UnitEntityBase role) { }
public override void Execute(UnitEntityBase role, object param) { }
public override void Enter(UnitEntityBase role, double duration, object param) { role.AnimaControl.UnitPlayAnima("run", false /*, speed*/); }
protected bool m_isNegation = false; //是否取反 public void SetRoleAndIsNegation(UnitEntityBase unit, bool isNegation) { unitEntity = unit; m_isNegation = isNegation; }
//protected UnitEntityBase unit; //行为主体 public void SetRole(UnitEntityBase unitEntity) { //unit = unitEntity; }