(client)chore:修改了摄像机的跟踪方式,摄像机控制不再使用单例

This commit is contained in:
m0_75251201
2025-08-23 16:43:28 +08:00
parent 8916440e7e
commit da93368f02
15 changed files with 1215 additions and 329 deletions

View File

@ -54,10 +54,8 @@ namespace Entity
return;
// 计算当前向上方向与目标方向之间的角度
float angle = Mathf.Atan2(targetDirection.y, targetDirection.x) * Mathf.Rad2Deg;
// 调整角度因为默认贴图向上是0度而Atan2计算的是相对于x轴的角度
angle -= 90f;
var angle = Mathf.Atan2(targetDirection.y, targetDirection.x) * Mathf.Rad2Deg;
// 应用旋转
transform.rotation = Quaternion.Euler(0f, 0f, angle);