perf: 支持相机运镜
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user