ListenToSensors.cs 696 B

1234567891011121314151617181920212223242526
  1. using Sensors.ANT;
  2. using Sensors.Bluetooth;
  3. using UnityEngine;
  4. using UnityEngine.Serialization;
  5. namespace Sensors
  6. {
  7. public class ListenToSensors : MonoBehaviour
  8. {
  9. public SpeedSensorConfig speedSensorConfig;
  10. [FormerlySerializedAs("polarSensorConfig")] public BleSensorConfig bleSensorConfig;
  11. public int hrAntId;
  12. public int powerMeterId;
  13. private void Start()
  14. {
  15. BikeSensorData.Instance.StartListening(speedSensorConfig, bleSensorConfig, powerMeterId,
  16. hrAntId < 0 ? null : new int?(hrAntId));
  17. }
  18. private void OnDestroy()
  19. {
  20. BikeSensorData.Instance.Dispose();
  21. }
  22. }
  23. }