perf: 支持相机运镜

This commit is contained in:
richarjiang
2025-09-29 08:20:59 +08:00
parent ad51ba1262
commit facdae5c5e
4 changed files with 1549 additions and 731 deletions

View File

@@ -45,8 +45,16 @@ export class Shadow2D extends Component {
update(dt: number) {
if (!this.shadowNode || !this.target) return;
if (!this.target.active) {
this.shadowNode.active = false;
return;
}
// 始终保持在角色底部(比如角色动画高度变化时也能跟随)
let ui = this.target.getComponent(UITransform);
if (!ui) return;
this.shadowNode.setPosition(0, -ui.height / 2);
}
}