ListenToSensors.cs 621 B

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