-
Notifications
You must be signed in to change notification settings - Fork 341
NEW: Add LocationSensor for Input System #2469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
MorganHoarau
wants to merge
18
commits into
im-parity/staging
Choose a base branch
from
im-parity/isx-2227-location-sensor
base: im-parity/staging
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 14 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
3625a0a
feat: add LocationSensor
MorganHoarau c0fc488
feat: Add inputSystem location settings to editor
MorganHoarau 777eadd
test: add LocationSensor tests
MorganHoarau 5d4a284
docs: map Input.location to LocationSensor in old-to-new API table
MorganHoarau 66c5682
docs: improve location sensor xml doc
MorganHoarau 08d49df
Merge branch 'im-parity/staging' into im-parity/isx-2227-location-sensor
MorganHoarau f8f840b
Fixes comments grammar
MorganHoarau e34417d
Update Packages/com.unity.inputsystem/InputSystem/Runtime/Devices/Sen…
MorganHoarau 42c371c
Merge branch 'im-parity/isx-2227-location-sensor' of https://github.c…
MorganHoarau 4c9aef3
Update CHANGELOG.md
MorganHoarau 60caf6d
Update corresponding-old-new-api.md
MorganHoarau 166cb55
Decouple ISX from legacy LocationStatus enum
MorganHoarau fe5105e
Documents Location backend service limitation
MorganHoarau 2a473d8
Make Location commands internal
MorganHoarau 59c65e1
docs: document IL ref limitation for permission injection
MorganHoarau b8b9c2a
Update Packages/com.unity.inputsystem/Documentation~/corresponding-ol…
MorganHoarau 8288d75
update Loc sensor properties' remarks to mention thread requirement
MorganHoarau 02d9547
Merge branch 'im-parity/isx-2227-location-sensor' of https://github.c…
MorganHoarau File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...es/com.unity.inputsystem/InputSystem/Runtime/Devices/Commands/ConfigureLocationCommand.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| using System.Runtime.InteropServices; | ||
| using UnityEngine.InputSystem.Utilities; | ||
|
|
||
| namespace UnityEngine.InputSystem.LowLevel | ||
| { | ||
| /// <summary> | ||
| /// Command to set the desired accuracy and update-distance threshold of a <see cref="LocationSensor"/>. | ||
| /// </summary> | ||
| [StructLayout(LayoutKind.Explicit, Size = kSize)] | ||
| internal struct ConfigureLocationCommand : IInputDeviceCommandInfo | ||
| { | ||
| public static FourCC Type => new FourCC('L', 'C', 'F', 'G'); | ||
|
|
||
| internal const int kSize = InputDeviceCommand.kBaseCommandSize + sizeof(float) * 2; | ||
|
|
||
| [FieldOffset(0)] | ||
| public InputDeviceCommand baseCommand; | ||
|
|
||
| [FieldOffset(InputDeviceCommand.kBaseCommandSize)] | ||
| public float desiredAccuracyInMeters; | ||
|
|
||
| [FieldOffset(InputDeviceCommand.kBaseCommandSize + sizeof(float))] | ||
| public float updateDistanceInMeters; | ||
|
|
||
| public FourCC typeStatic => Type; | ||
|
|
||
| public static ConfigureLocationCommand Create(float desiredAccuracyInMeters, float updateDistanceInMeters) | ||
| { | ||
| return new ConfigureLocationCommand | ||
| { | ||
| baseCommand = new InputDeviceCommand(Type, kSize), | ||
| desiredAccuracyInMeters = desiredAccuracyInMeters, | ||
| updateDistanceInMeters = updateDistanceInMeters | ||
| }; | ||
| } | ||
| } | ||
| } |
2 changes: 2 additions & 0 deletions
2
...m.unity.inputsystem/InputSystem/Runtime/Devices/Commands/ConfigureLocationCommand.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
32 changes: 32 additions & 0 deletions
32
...ity.inputsystem/InputSystem/Runtime/Devices/Commands/QueryLocationEnabledByUserCommand.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| using System.Runtime.InteropServices; | ||
| using UnityEngine.InputSystem.Utilities; | ||
|
|
||
| namespace UnityEngine.InputSystem.LowLevel | ||
| { | ||
| /// <summary> | ||
| /// Command to query whether the user has granted OS-level permission for a <see cref="LocationSensor"/> to access location data. | ||
| /// </summary> | ||
| [StructLayout(LayoutKind.Explicit, Size = kSize)] | ||
| internal struct QueryLocationEnabledByUserCommand : IInputDeviceCommandInfo | ||
| { | ||
| public static FourCC Type => new FourCC('L', 'U', 'S', 'R'); | ||
|
|
||
| internal const int kSize = InputDeviceCommand.kBaseCommandSize + sizeof(bool); | ||
|
|
||
| [FieldOffset(0)] | ||
| public InputDeviceCommand baseCommand; | ||
|
|
||
| [FieldOffset(InputDeviceCommand.kBaseCommandSize)] | ||
| public bool enabledByUser; | ||
|
|
||
| public FourCC typeStatic => Type; | ||
|
|
||
| public static QueryLocationEnabledByUserCommand Create() | ||
| { | ||
| return new QueryLocationEnabledByUserCommand | ||
| { | ||
| baseCommand = new InputDeviceCommand(Type, kSize) | ||
| }; | ||
| } | ||
| } | ||
| } |
2 changes: 2 additions & 0 deletions
2
...nputsystem/InputSystem/Runtime/Devices/Commands/QueryLocationEnabledByUserCommand.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
33 changes: 33 additions & 0 deletions
33
.../com.unity.inputsystem/InputSystem/Runtime/Devices/Commands/QueryLocationStatusCommand.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| using System.Runtime.InteropServices; | ||
| using UnityEngine.InputSystem.Utilities; | ||
|
|
||
| namespace UnityEngine.InputSystem.LowLevel | ||
| { | ||
| /// <summary> | ||
| /// Command to query the current status of a <see cref="LocationSensor"/>'s underlying platform location service. | ||
| /// </summary> | ||
| [StructLayout(LayoutKind.Explicit, Size = kSize)] | ||
| internal struct QueryLocationStatusCommand : IInputDeviceCommandInfo | ||
| { | ||
| public static FourCC Type => new FourCC('L', 'S', 'T', 'A'); | ||
|
|
||
| internal const int kSize = InputDeviceCommand.kBaseCommandSize + sizeof(int); | ||
|
|
||
| [FieldOffset(0)] | ||
| public InputDeviceCommand baseCommand; | ||
|
|
||
| // 0 Stopped, 1 Initializing, 2 Running, 3 Failed (matches LocationServiceStatus). | ||
| [FieldOffset(InputDeviceCommand.kBaseCommandSize)] | ||
| public int status; | ||
|
|
||
| public FourCC typeStatic => Type; | ||
|
|
||
| public static QueryLocationStatusCommand Create() | ||
| { | ||
| return new QueryLocationStatusCommand | ||
| { | ||
| baseCommand = new InputDeviceCommand(Type, kSize) | ||
| }; | ||
| } | ||
| } | ||
| } |
2 changes: 2 additions & 0 deletions
2
...unity.inputsystem/InputSystem/Runtime/Devices/Commands/QueryLocationStatusCommand.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI @suearkinunity