1
This commit is contained in:
@@ -27,23 +27,4 @@ public class ModuleCamera : ModuleSingle<ModuleCamera> {
|
||||
/// <summary> 重置相机 </summary>
|
||||
public void ResetCamera() => cameras.ForEach(obj => obj.ResetCamera());
|
||||
|
||||
/// <summary>
|
||||
/// 转换方向
|
||||
/// </summary>
|
||||
/// <param name="forward">相机的前方</param>
|
||||
/// <param name="right">相机的右方</param>
|
||||
/// <param name="moveInput">输入的移动方向</param>
|
||||
/// <returns>Y轴向上的平面移动方向</returns>
|
||||
public static Vector3 TransferDirection(Vector3 forward, Vector3 right, Vector2 moveInput) {
|
||||
// 确保前方和右方方向在水平面上
|
||||
forward.y = 0;
|
||||
right.y = 0;
|
||||
|
||||
// 归一化方向向量
|
||||
forward.Normalize();
|
||||
right.Normalize();
|
||||
|
||||
// 计算移动方向
|
||||
return (forward * moveInput.y + right * moveInput.x).normalized;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user