Skip to content

Commit 178b2a3

Browse files
author
Unity Technologies
committed
com.unity.xr.visionos@0.1.2
# Changelog All notable changes to this package will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased] ### This is the first release of *Unity Package Apple visionOS XR Plugin*. *Provides XR support for visionOS*
1 parent 7c31d4f commit 178b2a3

25 files changed

+102
-171
lines changed

Editor/ImageTracking/ARReferenceImage.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.IO;
33
using UnityEngine;
44
using UnityEngine.XR.ARSubsystems;
5+
using UnityEngine.XR.VisionOS;
56

67
namespace UnityEditor.XR.VisionOS
78
{
@@ -133,7 +134,7 @@ public ARReferenceImage(XRReferenceImage referenceImage)
133134
}
134135

135136
m_Width = referenceImage.width;
136-
name = referenceImage.name + "_" + referenceImage.guid.ToUUIDString();
137+
name = VisionOSImageDatabase.GetReferenceImageName(referenceImage.name, referenceImage.guid);
137138
}
138139
}
139140
}

Editor/VisionOSBuildProcessor.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,6 @@ static bool ShouldIncludeRuntimePluginsInBuild(string path)
7575
var settings = VisionOSSettings.currentSettings;
7676
if (settings.appMode == VisionOSSettings.AppMode.MR)
7777
{
78-
if (path.Contains("UnityVisionOS.m"))
79-
return false;
80-
8178
if (path.Contains(".swift"))
8279
return false;
8380
}

Editor/VisionOSPackageMetadata.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ class VisionOSPackageMetadata : IXRPackageMetadata
3636
loaderType = typeof(VisionOSLoader).FullName,
3737
supportedBuildTargets = new List<BuildTargetGroup>()
3838
{
39-
BuildTargetGroup.VisionOS,
40-
BuildTargetGroup.Standalone
39+
BuildTargetGroup.VisionOS
4140
}
4241
},
4342
}
File renamed without changes.

Runtime/InputLayoutLoader.cs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#if INCLUDE_UNITY_INPUT_SYSTEM
2+
using UnityEngine.InputSystem.Layouts;
3+
using UnityEngine.InputSystem.XR;
4+
using UnityEngine.XR.ARSubsystems;
5+
6+
using Inputs = UnityEngine.InputSystem.InputSystem;
7+
8+
#if UNITY_EDITOR
9+
using UnityEditor;
10+
#endif
11+
12+
namespace UnityEngine.XR.VisionOS
13+
{
14+
#if UNITY_EDITOR
15+
[InitializeOnLoad]
16+
#endif
17+
public class InputLayoutLoader
18+
{
19+
#if UNITY_EDITOR
20+
static InputLayoutLoader()
21+
{
22+
RegisterLayouts();
23+
}
24+
#endif
25+
26+
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
27+
static void RegisterLayouts()
28+
{
29+
Inputs.RegisterLayout<HandheldARInputDevice>(
30+
matches: new InputDeviceMatcher()
31+
.WithInterface(XRUtilities.InterfaceMatchAnyVersion)
32+
.WithProduct("(visionOS)")
33+
);
34+
}
35+
}
36+
}
37+
#endif

Runtime/InputLayoutLoader.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Runtime/Unity.XR.VisionOS.asmdef

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"references": [
55
"Unity.XR.ARSubsystems",
66
"Unity.XR.Management",
7-
"Unity.XR.Hands"
7+
"Unity.XR.Hands",
8+
"Unity.InputSystem"
89
],
910
"includePlatforms": [
1011
"Editor",
@@ -26,6 +27,11 @@
2627
"name": "com.unity.xr.hands",
2728
"expression": "1.1.0",
2829
"define": "INCLUDE_UNITY_XR_HANDS_1_1"
30+
},
31+
{
32+
"name": "com.unity.inputsystem",
33+
"expression": "1.0.0",
34+
"define": "INCLUDE_UNITY_INPUT_SYSTEM"
2935
}
3036
],
3137
"noEngineReferences": false

Runtime/VisionOSAnchorSubsystem.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ public VisionOSProvider()
4242

4343
public override void Destroy()
4444
{
45-
Debug.Log("Destroy world tracking provider");
4645
m_AddedAnchors.Dispose();
4746
m_UpdatedAnchors.Dispose();
4847
m_RemovedAnchors.Dispose();
@@ -53,14 +52,12 @@ public override void Destroy()
5352

5453
public override void Start()
5554
{
56-
Debug.Log("Start anchor provider");
5755
m_WorldTrackingProvider = VisionOSSessionSubsystem.VisionOSProvider.Instance.WorldTrackingProvider;
5856
NativeApi_World_Tracking.UnityVisionOS_impl_ar_world_tracking_provider_set_anchor_update_handler(m_WorldTrackingProvider, k_WorldTrackingUpdateHandler);
5957
}
6058

6159
public override void Stop()
6260
{
63-
Debug.Log("Stop anchor provider");
6461
// Do nothing here, SessionSubsystem manages the lifecycle of WorldTrackingProvider
6562
// TODO: Unsubscribe from updates? Re-create provider?
6663
}

Runtime/VisionOSHandProvider.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,13 @@ public override unsafe void Start()
3131
}
3232
}
3333

34-
Debug.Log("Start hand provider");
3534
m_HandTrackingConfiguration = NativeApi_Hand_Tracking.ar_hand_tracking_configuration_create();
3635
m_HandTrackingProvider = NativeApi_Hand_Tracking.ar_hand_tracking_provider_create(m_HandTrackingConfiguration);
3736
VisionOSSessionSubsystem.VisionOSProvider.Instance.AddDataProvider(m_HandTrackingProvider);
3837
}
3938

4039
public override void Stop()
4140
{
42-
Debug.Log("Stop hand provider");
4341
VisionOSSessionSubsystem.VisionOSProvider.Instance.RemoveDataProvider(m_HandTrackingProvider);
4442
}
4543

0 commit comments

Comments
 (0)