Ship mounts: hide the thruster emitter with the invisible material

forceRenderingOff is not serialized, so the prototype's clone drew the
emitter again; the preview smoke's clone check caught it. The emitter's
materials become the template's invisible material, which survives
Instantiate and which EntityInstance keeps as the renderer's own material.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-03 14:48:51 +02:00
commit da2a299baa
2 changed files with 5 additions and 2 deletions

View file

@ -123,9 +123,11 @@ public static class ShipModShips
var thrusters = plan.Thrusters.Select(id =>
{
// The thruster's mesh is its exhaust's emission surface, never drawn (ruling thrusters-radiators-are-meshes).
// The invisible material is serialized, so it survives the prototype's clone, and EntityInstance keeps it as
// this renderer's visible material; forceRenderingOff would not survive Instantiate.
var hardpoint = AddOrGet<ThrusterHardpoint>(Node(id).gameObject);
hardpoint.Emitter = Renderer(id);
hardpoint.Emitter.forceRenderingOff = true;
hardpoint.Emitter.sharedMaterials = Enumerable.Repeat(template.Invisible, hardpoint.Emitter.sharedMaterials.Length).ToArray();
return hardpoint;
}).ToArray();
var radiators = plan.Radiators.Select(id =>