refactor(hero): 优化英雄对象池管理及视图初始化

- 在Monster类中实现多键对象池管理,提升英雄节点复用效率
- 将HeroViewComp的初始化逻辑提取到独立init方法,便于对象池复用时重置状态
- 移除HeroSpine中冗余的onDestroy方法
- 修复HeroViewComp中方向缩放计算问题,确保scale.x为正
- 优化碰撞体启用逻辑,延迟一帧确保物理系统正确注册
- 清理HeroViewComp中残留的定时器和缓动
This commit is contained in:
walkpan
2026-01-02 23:27:05 +08:00
parent 2c7a628921
commit 81f55a796d
4 changed files with 77 additions and 22 deletions

View File

@@ -85,8 +85,5 @@ export class HeroSpine extends Component {
this.status="move"
this.anm.move()
}
onDestroy() {
this.node.destroy();
}
}