Created field bubble shields / propulsion, currently just a prototype with its own test scene
This commit is contained in:
Reinier Vens 2025-01-30 01:58:05 +00:00
commit c6ffcad3f1
213 changed files with 2145 additions and 1213 deletions

View file

@ -337,7 +337,7 @@ public class EntityInstance : MonoBehaviour
// U coordinate between 0-1 indicates a hit that didn't land directly on a hardpoint
// Find the 2D position of the hit scaled to the schematic
float2 hitPos = float2.zero;
if (hardpointIndex < 0)
if (hardpointIndex < 0 || hardpointIndex >= hullData.Hardpoints.Count)
{
hitPos = float2(hit.TexCoord.x * hullData.Shape.Width, hit.TexCoord.y * hullData.Shape.Height);
// Search all schematic border cells for the cell which is closest to the hit position