(client) feat:添加消息定义,添加故事定义及其运算,武器动画可用,装备UI可用以及切换武器 fix:修复快速攻击导致协程释放出错卡死,重构为计时器,修复类型转换错误导致报错

This commit is contained in:
m0_75251201
2025-09-08 00:13:12 +08:00
parent 15cdd2b244
commit 379ed07773
39 changed files with 8353 additions and 937 deletions

View File

@ -0,0 +1,21 @@
using UnityEngine;
namespace Utils
{
public static class RotateTool
{
// 旋转对象到指定方向
public static void RotateTransformToDirection(Transform transform, Vector3 targetDirection)
{
// 确保目标方向不是零向量
if (targetDirection == Vector3.zero)
return;
// 计算当前向上方向与目标方向之间的角度
var angle = Mathf.Atan2(targetDirection.y, targetDirection.x) * Mathf.Rad2Deg;
// 应用旋转
transform.rotation = Quaternion.Euler(0f, 0f, angle);
}
}
}