internal static void PlatformStart(SensorSpeed sensorSpeed) { var delay = sensorSpeed.ToPlatform(); listener = new AccelerometerListener(); accelerometer = Platform.SensorManager.GetDefaultSensor(SensorType.Accelerometer); Platform.SensorManager.RegisterListener(listener, accelerometer, delay); }
internal static void PlatformStop() { if (listener == null || accelerometer == null) { return; } Platform.SensorManager.UnregisterListener(listener, accelerometer); listener.Dispose(); listener = null; }