Deletes the Time.deltaTime gravity/drag/position integration and the range-distance kill from Projectile and the UnityEngine.Random jitter, barrel direction and inherited velocity from ProjectileManager. A round holds a copy of its PendingShot and draws at RoundAt(Zone.Time + Clock.Lead) with a barrel offset decaying over BlendTime; ShotResolved ends a hit or burst at the outcome's BurstPoint, a miss flies to the FireRange clamp. Unity compile not yet run at this commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
17 lines
763 B
C#
17 lines
763 B
C#
using UnityEngine;
|
|
|
|
public class ProjectileManager : InstantWeaponEffectManager
|
|
{
|
|
public Prototype ProjectilePrototype;
|
|
|
|
// The round is drawn on the line the simulation flies it (FireControl.RoundAt), so there is nothing to aim, jitter
|
|
// or inherit here: spread is priced by FireControl, and the sim's round inherits nothing from its shooter.
|
|
public override void Fire(InstantWeapon weapon, EquippedItem item, EntityInstance source, EntityInstance target, int shotId)
|
|
{
|
|
var zone = source.Entity.Zone;
|
|
if (!zone.TryGetShot(shotId, out var shot)) return;
|
|
var p = ProjectilePrototype.Instantiate<Projectile>();
|
|
p.Launch(zone, shot, source.GetBarrel(item.Hardpoint).position);
|
|
p.Trail.Clear();
|
|
}
|
|
}
|