Layers: one owner puts orbitals above the ship plane and floaters below; per-hull GridOffset is deleted
GameplaySettings carries ShipLayerHeight 3, OrbitalLayerHeight 15, FloaterLayerHeight 0 (authored in Settings.asset). Entity.LayerHeight (Ship, OrbitalEntity) is the one offset RideHeight adds; DrawAhead.FloaterHeight is the floater height ItemPickup and MineInstance draw at. HullData.GridOffset (Key 26) and the pickup/mine/prefab GridOffset fields are gone with every reader. Fixtures (DrawnPose, FireControl*, ImpactFeedback) take heights from the layer owner; LayerTests pin each kind's layer. FloatingItemsDrawnSmoke follows. ItemPickup/MineInstance.Bind take the settings from ZoneRenderer. Builds as one commit with its tests; not compile-verified until the cut's head run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
624d5420e9
commit
be7f2b0787
23 changed files with 205 additions and 51 deletions
|
|
@ -12,7 +12,6 @@ using Random = UnityEngine.Random;
|
|||
public class ItemPickup : MonoBehaviour
|
||||
{
|
||||
public float RotationSpeed = 1f;
|
||||
public float GridOffset;
|
||||
public float LabelFadeDuration = .5f;
|
||||
public float LabelPersistDuration = 3;
|
||||
public float LabelDisplayAngle = 15;
|
||||
|
|
@ -27,11 +26,13 @@ public class ItemPickup : MonoBehaviour
|
|||
private float _displayTime;
|
||||
private float _timeOffset;
|
||||
private Zone _zone;
|
||||
private GameplaySettings _settings;
|
||||
private FloatingItem _floating;
|
||||
|
||||
public void Bind(Zone zone, FloatingItem floating)
|
||||
public void Bind(Zone zone, FloatingItem floating, GameplaySettings settings)
|
||||
{
|
||||
_zone = zone;
|
||||
_settings = settings;
|
||||
_floating = floating;
|
||||
Item = floating.Item;
|
||||
_timeOffset = Random.value * 100;
|
||||
|
|
@ -42,7 +43,7 @@ public class ItemPickup : MonoBehaviour
|
|||
{
|
||||
var lead = ActionGameManager.Clock.Lead;
|
||||
var p = DrawAhead.Position(_floating.Body, lead);
|
||||
transform.position = new Vector3(p.x, DrawAhead.Height(_zone, p, lead) + GridOffset, p.y);
|
||||
transform.position = new Vector3(p.x, DrawAhead.FloaterHeight(_zone, _settings, p, lead), p.y);
|
||||
}
|
||||
|
||||
private void Update()
|
||||
|
|
|
|||
|
|
@ -17,21 +17,22 @@ public class MineInstance : MonoBehaviour
|
|||
public float ActiveEmission = 100f;
|
||||
public float ArmedEmission = 1000f;
|
||||
public float RotationSpeed = 1f;
|
||||
public float GridOffset;
|
||||
// The blast's particles; the effect prefab destroys itself when its particle system stops.
|
||||
public GameObject HitEffect;
|
||||
public float HitEffectScale = 10f;
|
||||
|
||||
private Zone _zone;
|
||||
private GameplaySettings _settings;
|
||||
private Mine _mine;
|
||||
private Material _material;
|
||||
private float _timeOffset;
|
||||
private float _pulse;
|
||||
private float _emission;
|
||||
|
||||
public void Bind(Zone zone, Mine mine)
|
||||
public void Bind(Zone zone, Mine mine, GameplaySettings settings)
|
||||
{
|
||||
_zone = zone;
|
||||
_settings = settings;
|
||||
_mine = mine;
|
||||
_material = MeshRenderer.materials[EmissionSubmesh];
|
||||
_timeOffset = Random.value * 100;
|
||||
|
|
@ -57,7 +58,7 @@ public class MineInstance : MonoBehaviour
|
|||
{
|
||||
var lead = ActionGameManager.Clock.Lead;
|
||||
var p = DrawAhead.Position(_mine.Body, lead);
|
||||
transform.position = new Vector3(p.x, DrawAhead.Height(_zone, p, lead) + GridOffset, p.y);
|
||||
transform.position = new Vector3(p.x, DrawAhead.FloaterHeight(_zone, _settings, p, lead), p.y);
|
||||
}
|
||||
|
||||
// The mine left Zone.Mines, which only its blast does: show it where it was drawn last.
|
||||
|
|
|
|||
Loading…
Reference in a new issue