Exemple #1
0
        internal static void PlatformStart(SensorSpeed sensorSpeed)
        {
            var delay = sensorSpeed.ToPlatform();

            listener          = new OrientationSensorListener();
            orientationSensor = Platform.SensorManager.GetDefaultSensor(SensorType.RotationVector);
            Platform.SensorManager.RegisterListener(listener, orientationSensor, delay);
        }
Exemple #2
0
        internal static void PlatformStop()
        {
            if (listener == null || orientationSensor == null)
            {
                return;
            }

            Platform.SensorManager.UnregisterListener(listener, orientationSensor);
            listener.Dispose();
            listener = null;
        }