(client) feat:添加UI多线段绘制器,贝塞尔曲线绘制器及其编辑器, fix:单目标子弹在一帧内击中多个目标未被限制击中数量

This commit is contained in:
m0_75251201
2025-09-09 20:10:21 +08:00
parent 6cb4483d20
commit d1c0387df0
17 changed files with 1142 additions and 117 deletions

View File

@ -216,6 +216,7 @@ namespace Entity
return;
weaponItem=GameObjectCreate.SpriteAnimator(currentWeapon.Icon.ToArray(), weaponAnimator.transform);
weaponItem.SetFPS(currentWeapon.FPS);
weaponItem.gameObject.SetActive(true);
weaponAttackAnimation = GameObjectCreate.SpriteAnimator(currentWeapon.AttackAnimation.ToArray(),
weaponAnimator.transform);
@ -393,7 +394,7 @@ namespace Entity
private void StartAttack(WeaponResource weaponResource)
{
_attackTimer = weaponResource.AttackCooldown;
_attackDetectionTime = weaponResource.AttackDetectionTime;
_attackDetectionTime =Mathf.Max(0,weaponResource.AttackCooldown- weaponResource.AttackDetectionTime);
currentAttackWeapon = weaponResource;
if (weaponResource.AttackAnimationTime > 0)
@ -594,8 +595,13 @@ namespace Entity
{
var mousePos = MousePosition.GetWorldPosition();
attackDirection = new Vector3(mousePos.x,mousePos.y) - Position;
RotateTool.RotateTransformToDirection(weaponItem.transform, attackDirection);
}
if (Input.GetKeyDown(KeyCode.V))
{
weaponItem.gameObject.SetActive(!weaponItem.gameObject.activeSelf);
}
// 获取当前键盘输入状态2D 移动,只使用 X 和 Y 轴)
var inputDirection = Vector2.zero;