-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
## [1.6.0] - 2022-11-29 ### Fixed * Fixed black game window issue when building a URP project. * Fixed `InputDevice.TryGetHapticCapabilities` always return True with OpenXR. * Fixed repeated warnings for failed to restart OpenXR when no HMD is attached. * Fixed invalid pose values got populated when tracked flags are invalid. * Fixed XR_SPACE_BOUNDS_UNAVAILABLE return code marked as Error in the log. ### Updated * Updated Input System dependency to 1.4.4. ### Added * Added `Meta Quest Feature` support for Android and deprecated previous `Oculus Quest Feature`. Also added a new validation rule to support new Meta Quest Feature migration. * Added API `MetaQuestFeature.AddTargetDevice` to add additional target devices to the devices list in the MetaQuestFeatureEditor. * Added Thumbrest Touch support in Oculus Touch Controller Interaction Profile. * Added a new optional validation rule to switch to use InputSystem.XR.PoseControl instead of OpenXR.Input.PoseControl, which fixed PoseControl conflicts in InputSystem.XR and OpenXR.Input. Note: If opt in to use InputSystem.XR.PoseControl, `USE_INPUT_SYSTEM_POSE_CONTROL` will be added in Scripting Define Symbols under Player settings.
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using UnityEngine.XR.OpenXR; | ||
|
||
using UnityEngine.XR.OpenXR.Features.MetaQuestSupport; | ||
|
||
namespace UnityEditor.XR.OpenXR.Features.MetaQuestSupport | ||
{ | ||
[CustomEditor(typeof(MetaQuestFeature))] | ||
internal class MetaQuestFeatureEditor : Editor | ||
{ | ||
struct TargetDeviceProperty | ||
{ | ||
public SerializedProperty property; | ||
public GUIContent label; | ||
} | ||
|
||
private List<TargetDeviceProperty> targetDeviceProperties; | ||
private Dictionary<string, bool> activeTargetDevices; | ||
|
||
void InitActiveTargetDevices() | ||
{ | ||
activeTargetDevices = new Dictionary<string, bool>(); | ||
|
||
OpenXRSettings androidOpenXRSettings = OpenXRSettings.GetSettingsForBuildTargetGroup(BuildTargetGroup.Android); | ||
var questFeature = androidOpenXRSettings.GetFeature<MetaQuestFeature>(); | ||
|
||
if (questFeature == null) | ||
return; | ||
|
||
foreach (var dev in questFeature.targetDevices) | ||
{ | ||
activeTargetDevices.Add(dev.manifestName, dev.active); | ||
} | ||
} | ||
void OnEnable() | ||
{ | ||
targetDeviceProperties = new List<TargetDeviceProperty>(); | ||
InitActiveTargetDevices(); | ||
if (activeTargetDevices.Count == 0) | ||
return; | ||
var targetDevicesProperty = serializedObject.FindProperty("targetDevices"); | ||
|
||
for (int i = 0; i < targetDevicesProperty.arraySize; ++i) | ||
{ | ||
var targetDeviceProp = targetDevicesProperty.GetArrayElementAtIndex(i); | ||
var propManifestName = targetDeviceProp.FindPropertyRelative("manifestName"); | ||
|
||
// don't present inactive target devices to the user | ||
if (propManifestName == null || activeTargetDevices[propManifestName.stringValue] == false) | ||
continue; | ||
var propEnabled = targetDeviceProp.FindPropertyRelative("enabled"); | ||
var propName = targetDeviceProp.FindPropertyRelative("visibleName"); | ||
TargetDeviceProperty curTarget = new TargetDeviceProperty {property = propEnabled, label = EditorGUIUtility.TrTextContent(propName.stringValue)}; | ||
targetDeviceProperties.Add(curTarget); | ||
} | ||
} | ||
|
||
public override void OnInspectorGUI() | ||
{ | ||
serializedObject.Update(); | ||
EditorGUILayout.LabelField("Target Devices", EditorStyles.boldLabel); | ||
|
||
foreach (var device in targetDeviceProperties) | ||
{ | ||
EditorGUILayout.PropertyField(device.property, device.label); | ||
} | ||
|
||
serializedObject.ApplyModifiedProperties(); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.