-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
76 changed files
with
5,312 additions
and
491 deletions.
There are no files selected for viewing
This file contains 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 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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,36 @@ | ||
using System; | ||
using UnityEngine; | ||
using UnityEngine.InputSystem; | ||
using UnityEngine.UI; | ||
|
||
public class HingeAngleTest : MonoBehaviour | ||
{ | ||
[Serializable] | ||
class SensorCapabilities | ||
{ | ||
public int sensorType; | ||
public float resolution; | ||
public int minDelay; | ||
} | ||
|
||
public Text info; | ||
SensorCapabilities caps; | ||
void Start() | ||
{ | ||
if (HingeAngle.current != null) | ||
{ | ||
InputSystem.EnableDevice(HingeAngle.current); | ||
caps = JsonUtility.FromJson<SensorCapabilities>(HingeAngle.current.description.capabilities); | ||
} | ||
} | ||
|
||
// Update is called once per frame | ||
void Update() | ||
{ | ||
if (HingeAngle.current != null) | ||
{ | ||
info.text = $"Capabilities: resolution = {caps.resolution}, minDelay = {caps.minDelay}\n" + | ||
$"Angle: {HingeAngle.current.angle.ReadValue()}"; | ||
} | ||
} | ||
} |
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.