接入ResLogin.otherPlayers

This commit is contained in:
janing
2025-12-18 16:04:56 +08:00
parent 03276fe1f6
commit 8f58b890be
21 changed files with 861 additions and 87 deletions

View File

@@ -40,8 +40,8 @@ export class RemotePlayer {
this.playerName = playerName;
const x = position.x / 1000
const y = position.y / 1000
this.currentPosition.set(x, 0, y);
this.targetPosition.set(x, 0, y);
this.currentPosition.set(x, y, 0);
this.targetPosition.set(x, y, 0);
// 获取 RoleController 组件
this.roleController = this.playerNode.getComponentInChildren(RoleController);
@@ -79,7 +79,7 @@ export class RemotePlayer {
// 计算朝向
if (distance > 0.01) {
const targetAngle = Math.atan2(direction.x, -direction.z) * (180 / Math.PI);
const targetAngle = Math.atan2(direction.x, -direction.y) * (180 / Math.PI);
this.playerNode.setRotationFromEuler(0, targetAngle, 0);
}