Class iOSStepCounter
Step Counter (also known as pedometer) sensor for iOS.
Inherited Members
Namespace: UnityEngine.InputSystem.iOS.LowLevel
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 |
Methods
ExecuteCommand(InputDeviceCommand*)
Declaration
protected override long ExecuteCommand(InputDeviceCommand*commandPtr)
Parameters
Type | Name | Description |
---|---|---|
InputDeviceCommand* | commandPtr |
Returns
Type | Description |
---|---|
Int64 |
Overrides
IsAvailable()
Does the phone support the pedometer?
Declaration
public static bool IsAvailable()
Returns
Type | Description |
---|---|
Boolean |