摄像机区域的架构改动

This commit is contained in:
2026-05-15 14:47:24 +08:00
parent 1b37297585
commit f264329751
3591 changed files with 1687228 additions and 446503 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;
}
}
}