PuppetPath.ts 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import { ecs } from "../../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
  2. import { ECSEntity } from "../../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECSEntity";
  3. import { PathFindComp } from "../../common/ecs/path/PathFind";
  4. import { PuppetModelComp } from "../model/PuppetModelComp";
  5. import { Puppet } from "../puppet";
  6. /**
  7. * 第一行是否
  8. */
  9. @ecs.register('PuppetPath')
  10. export class PuppetPathComp extends ecs.Comp {
  11. reset() {
  12. }
  13. }
  14. export class PuppetPathSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate {
  15. filter(): ecs.IMatcher {
  16. return ecs.allOf(PathFindComp, PuppetModelComp);
  17. }
  18. update(e: Puppet): void {
  19. // console.log(e.PathFind)
  20. // console.log('人物寻路')
  21. if (e.PathFind && e.PathFind.canReach) {
  22. // if (e.PuppetModel.x === 0) {
  23. // console.log('当前是否可到达', e.PathFind.canReach)
  24. // console.log('当前格子序号', e.PuppetModel.x, e.PuppetModel.y)
  25. // console.log('当前路径', e.PathFind.path)
  26. // }
  27. }
  28. }
  29. }