private void PlayerBioscanSetStateHaptics(eBioscanStatus status, float progress, List <PlayerAgent> playersInScan) { if (!VRConfig.configUseBhaptics.Value || playersInScan == null) { return; } if (status == eBioscanStatus.Scanning && playersInScan.Contains(m_player) && m_player.Alive) { if (m_nextBodyscanPatternTime <= 0) { m_nextBodyscanPatternTime = Time.time; } m_bioscanStopFramesCount = 0; } else if (m_bioscanStopFramesCount == 0 && m_nextBodyscanPatternTime > 0) { // Indicate that bioscan stopped, and stop haptic pattern only after a few FixedUpdate() calls if we don't receive any other scan activations until then. // When multiple players are in different single-person scans, we receive this event every fixed frame for *each* currently scanned player, // and m_player is only in a single playersInScan list, so we don't want to stop the scan right when we receive the scan of someone else. m_bioscanStopFramesCount = 1; } }
public static void SetBioscanState(eBioscanStatus status, float progress, List <PlayerAgent> playersInScan) { OnBioscanSetState?.Invoke(status, progress, playersInScan); }
private static void Postfix(eBioscanStatus status, float progress, List <PlayerAgent> playersInScan) { PlayerInteractionEvents.SetBioscanState(status, progress, playersInScan); }