2026-10-03 15:39:14 +02:00
|
|
|
|
using UnityEngine;
|
2021-01-05 02:56:17 +00:00
|
|
|
|
|
|
|
|
|
|
public class ThrusterHardpoint : MonoBehaviour
|
|
|
|
|
|
{
|
|
|
|
|
|
public MeshRenderer Emitter;
|
2026-10-03 15:39:14 +02:00
|
|
|
|
|
|
|
|
|
|
// Points an exhaust's shape at a hardpoint's emitter, or at nothing when the ship has no such hardpoint. The emitter
|
|
|
|
|
|
// carries the invisible material (alpha 0), so the particles never take their colour from its mesh: with Use Mesh
|
|
|
|
|
|
// Colors on, Unity's default, they would all be born transparent.
|
|
|
|
|
|
public static void WireExhaust(ParticleSystem exhaust, ThrusterHardpoint hardpoint)
|
|
|
|
|
|
{
|
|
|
|
|
|
var shape = exhaust.shape;
|
|
|
|
|
|
shape.useMeshColors = false;
|
|
|
|
|
|
shape.meshRenderer = hardpoint != null ? hardpoint.Emitter : null;
|
|
|
|
|
|
}
|
2021-01-05 02:56:17 +00:00
|
|
|
|
}
|