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 motion
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 |
---|---|
Motion |
See Also
Methods
ExecuteCommand(InputDeviceCommand*)
Declaration
protected override long ExecuteCommand(InputDeviceCommand* commandPtr)
Parameters
Type | Name | Description |
---|---|---|
Input |
commandPtr |
Returns
Type | Description |
---|---|
long |
Overrides
See Also
IsAvailable()
Does the phone support the pedometer?
Declaration
public static bool IsAvailable()
Returns
Type | Description |
---|---|
bool |