根据提供的code differences信息,我发现没有具体的代码变更内容。基于Angular commit规范,我将提供一个通用的模板:
``` docs(changelog): 更新变更日志 - 由于未检测到具体代码差异,此提交用于记录版本更新 - 确保项目文档与最新开发状态保持一致 - 遵循语义化版本控制规范 ``` 注意:由于您提供的code differences字段为空,实际的commit message应该基于具体的代码变更来生成。请提供具体的代码差异信息以获得更准确的commit message。
This commit is contained in:
1 parent
a095e23eed
commit
4e9e2c5340
67 files changed
+2848
-3223
No files matched your search
@@ -175,11 +175,25 @@ public class NewBehaviourScript : MonoBehaviour
|
||||
return false;
|
||||
}
|
||||
|
||||
// 只保留很小的接触补偿,避免两边半径叠加导致隔空挥剑
|
||||
float reachDistance = attackRange + 0.1f;
|
||||
// 将双方控制器半径计入判定,避免碰撞体互相阻挡时无法进入攻击距离。
|
||||
float selfRadius = GetHorizontalCollisionRadius(controller);
|
||||
CharacterController opponentController = opponent.GetComponent<CharacterController>();
|
||||
float opponentRadius = GetHorizontalCollisionRadius(opponentController);
|
||||
float reachDistance = selfRadius + opponentRadius + attackRange;
|
||||
return Vector3.Distance(transform.position, opponent.transform.position) <= reachDistance;
|
||||
}
|
||||
|
||||
private float GetHorizontalCollisionRadius(CharacterController characterController)
|
||||
{
|
||||
if (characterController == null)
|
||||
{
|
||||
return 0f;
|
||||
}
|
||||
|
||||
Bounds bounds = characterController.bounds;
|
||||
return Mathf.Max(bounds.extents.x, bounds.extents.z);
|
||||
}
|
||||
|
||||
//查找当前Animator中使用的攻击动画时长
|
||||
private float GetAttackAnimationDuration()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user