Present landed impacts: shield ripple, hull reaction and camera kick through one ImpactPresenter

ImpactPresenter (bound on every EntityInstance by SetEntity through the one CapabilityPresentationBinder) renders
feedback-1's absorbs: Feedback.Cue decides intensity and shake, DrawAhead.Carried the drawn point; a hull absorb
spawns ImpactFeedback's pooled effect under the instance, and a cue with shake raises a Cinemachine impulse.
ShieldManager ripples on a Shield-layer absorb. MainMenu gains a Screen Shake slider that persists on Back.
Editor: WireImpactFeedback (scene wiring, scene diff in the next commit) and ImpactPresenterSmoke.
Unity batchmode compile 0 error CS; ImpactPresenterSmoke exit 0. The scene is not yet wired in this commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-12 21:10:04 +02:00
commit 97d94ecfae
11 changed files with 310 additions and 1 deletions

View file

@ -8,7 +8,7 @@ using static CultMath.math;
using UniRx;
using UnityEngine;
public class ShieldManager : MonoBehaviour
public class ShieldManager : MonoBehaviour, IAbsorbPresenter
{
public Prototype ShieldPrototype;
public float CollisionHitDuration = 3;
@ -86,6 +86,14 @@ public class ShieldManager : MonoBehaviour
}
}
// A shot the shield took ripples it where the shot landed, drawn on the hull as it is drawn. The hull layer is
// ImpactPresenter's.
public void Absorb(AbsorbEvent e)
{
if (e.Layer != AbsorbLayer.Shield || Entity == null || Entity.Shield == null || !Entity.Shield.Item.Active.Value) return;
ShowHit(DrawAhead.Carried(Entity, e.Position, ActionGameManager.Clock.Lead).ToUnity(), CollisionHitDuration);
}
public void ShowHit(Vector3 point, float duration)
{
var shield = ShieldPrototype.Instantiate<ShieldAnimation>();