多轮审查和修复

This commit is contained in:
2026-05-12 15:34:08 +08:00
parent f55d2a57c3
commit ebbbb7332e
805 changed files with 838724 additions and 1905 deletions

View File

@@ -0,0 +1,27 @@
using UnityEngine;
namespace BaseGames.Combat
{
/// <summary>
/// 抛物线抛射物。以 <see cref="ProjectileConfigSO.LaunchAngleDeg"/> 指定抛射角,
/// 并启用重力缩放,使子弹呈弧线飞行。
/// </summary>
public class ArcProjectile : Projectile
{
protected override void OnInitialized()
{
float rad = _config.LaunchAngleDeg * Mathf.Deg2Rad;
float vX = Mathf.Cos(rad) * _config.Speed * Mathf.Sign(Direction.x == 0f ? 1f : Direction.x);
float vY = Mathf.Sin(rad) * _config.Speed;
_rb.velocity = new Vector2(vX, vY);
_rb.gravityScale = _config.GravityScale;
}
protected override void OnDisable()
{
base.OnDisable();
_rb.gravityScale = 0f;
}
}
}