This commit is contained in:
2025-09-22 14:13:18 +08:00
parent ec35bf4e87
commit 26019a0080
5 changed files with 298 additions and 97 deletions
@@ -242,29 +242,12 @@ export class GirlDetailPanel extends li_BaseView {
: new Size(600, 800);
// 获取 videoArea 的中心位置,确保使用正确的世界坐标
const videoAreaPos = this.videoAreaPos;
if (this.videoArea) {
// 获取 videoArea 的世界坐标
this.videoAreaPos = this.videoArea.node.getWorldPosition();
// 也检查 videoLayer 的父节点信息,确保坐标系统一致
if (this.videoLayer && this.videoLayer.getVideoPlayer()) {
const videoPlayerParent =
this.videoLayer.getVideoPlayer().node.parent;
if (videoPlayerParent) {
const parentWorldPos = videoPlayerParent.getWorldPosition();
logger.log(
`GirlDetailPanel: VideoPlayer 父节点世界位置: (${parentWorldPos.x}, ${parentWorldPos.y}, ${parentWorldPos.z})`
);
}
}
}
// 使用新的统一 playVideo 方法
this.videoLayer.playVideo(firstPath, {
loop: true,
size: targetSize,
position: videoAreaPos,
position: this.videoAreaPos,
});
}