public override void Initialize() { Creature.AI.Blackboard.Erase("PathToEntity"); Creature.AI.Blackboard.Erase("EntityVoxel"); Tree = new Sequence( new Wrap(() => Creature.ClearBlackboardData("PathToEntity")), new Wrap(() => Creature.ClearBlackboardData("EntityVoxel")), InHands() | new Sequence( new ForLoop( new SetTargetVoxelFromEntityAct(Agent, EntityName, "EntityVoxel") & new PlanAct(Agent, "PathToEntity", "EntityVoxel", PlanAct.PlanType.Adjacent) & new Parallel(new FollowPathAnimationAct(Agent, "PathToEntity") * new Wrap(() => TargetMoved("PathToEntity")), new Wrap(CollidesWithTarget)) { ReturnOnAllSucces = false }, 5, true), new StopAct(Agent))); Tree.Initialize(); base.Initialize(); }
public override IEnumerable <Status> Run() { return(Creature.ClearBlackboardData(DataKey)); }