// ----------------------------------- Private helpers ---------------------------------------- private void ProbeTriggerHandler(Probe.ProbeType probeType, Probe.TriggerType triggerType) { if (probeType == Probe.ProbeType.LEFT_LEG) { if (triggerType == Probe.TriggerType.TRIGGER_STAY) { leftLegLanded = true; } else if (!simplifiedLanding && triggerType == Probe.TriggerType.TRIGGER_EXIT) { leftLegLanded = false; } } if (probeType == Probe.ProbeType.RIGHT_LEG) { if (triggerType == Probe.TriggerType.TRIGGER_STAY) { rightLegLanded = true; } else if (!simplifiedLanding && triggerType == Probe.TriggerType.TRIGGER_EXIT) { rightLegLanded = false; } } if (probeType == Probe.ProbeType.HULL && triggerType == Probe.TriggerType.TRIGGER_ENTER) { accidentOccured = true; } }
// ---------------------------------- Public API ---------------------------------------------- public static void SendProbeTriggerEvent(Probe.ProbeType probeType, Probe.TriggerType collisionType) { OnProbeCollided?.Invoke(probeType, collisionType); }