Class iOSStepCounter
Step Counter (also known as pedometer) sensor for iOS.
Inherited Members
Namespace: UnityEngine.InputSystem.iOS.LowLevel
Assembly: Unity.InputSystem.dll
Syntax
public class iOSStepCounter : StepCounter
Remarks
You need to enable Motion Usage in Input System settings (see motionUsage), to be allowed
to access the sensor on the user's device.
void Start()
{
InputSystem.EnableDevice(StepCounter.current);
}
void OnGUI()
{
GUILayout.Label(StepCounter.current.stepCounter.ReadValue().ToString());
}
Properties
AuthorizationStatus
Indicates whether the app is authorized to gather data for step counter sensor.
Declaration
public static MotionAuthorizationStatus AuthorizationStatus { get; }
Property Value
Type | Description |
---|---|
MotionAuthorizationStatus |
See Also
Methods
ExecuteCommand(InputDeviceCommand*)
Declaration
protected override long ExecuteCommand(InputDeviceCommand* commandPtr)
Parameters
Type | Name | Description |
---|---|---|
InputDeviceCommand* | commandPtr |
Returns
Type | Description |
---|---|
long |
Overrides
See Also
IsAvailable()
Does the phone support the pedometer?
Declaration
public static bool IsAvailable()
Returns
Type | Description |
---|---|
bool |