Skip to content

Commit 2439d15

Browse files
mderzellefacebook-github-bot
authored andcommitted
Upgraded to Mixed Reality Utility Kit
Summary: Implemented scene solution from Mixed Reality Utility Kit (MRUK) Upgrade to v74 SDK Reviewed By: yoavgoldsteinfb, AlexThiv Differential Revision: D75769746 fbshipit-source-id: f235701609dc9ca785de07ef099128b8fe468d2b
1 parent 2821797 commit 2439d15

File tree

109 files changed

+1687
-214597
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+1687
-214597
lines changed
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!114 &11400000
4+
MonoBehaviour:
5+
m_ObjectHideFlags: 0
6+
m_CorrespondingSourceObject: {fileID: 0}
7+
m_PrefabInstance: {fileID: 0}
8+
m_PrefabAsset: {fileID: 0}
9+
m_GameObject: {fileID: 0}
10+
m_Enabled: 1
11+
m_EditorHideFlags: 0
12+
m_Script: {fileID: 11500000, guid: 0bfde92e0a2190c4ca32f6fb0a0c73ce, type: 3}
13+
m_Name: MetaXRProjectSettings
14+
m_EditorClassIdentifier:
15+
boolProperties:
16+
keys:
17+
- Meta.XR.SDK.UsageSettings.UsesXRSimulator
18+
values: 01
19+
intProperties:
20+
keys: []
21+
values:

Assets/Phanto/Meshes/TestRoom/TestRoom.prefab.meta renamed to Assets/MetaXR/MetaXRProjectSettings.asset.meta

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

Assets/Oculus/OculusProjectConfig.asset

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ MonoBehaviour:
1212
m_Script: {fileID: 11500000, guid: 05d394ae2a81edd4cbc3c51917e766e3, type: 3}
1313
m_Name: OculusProjectConfig
1414
m_EditorClassIdentifier:
15-
targetDeviceTypes: 020000000300000004000000
15+
targetDeviceTypes: 02000000030000000400000005000000
1616
allowOptional3DofHeadTracking: 0
1717
handTrackingSupport: 0
1818
handTrackingFrequency: 0
@@ -25,21 +25,24 @@ MonoBehaviour:
2525
faceTrackingSupport: 0
2626
eyeTrackingSupport: 0
2727
virtualKeyboardSupport: 0
28+
colocationSessionSupport: 0
2829
sceneSupport: 2
2930
boundaryVisibilitySupport: 2
3031
disableBackups: 1
3132
enableNSCConfig: 1
3233
securityXmlPath:
34+
horizonOsSdkEnabled: 0
35+
minHorizonOsSdkVersion: 68
36+
targetHorizonOsSdkVersion: 74
3337
skipUnneededShaders: 0
3438
enableIL2CPPLTO: 0
39+
removeGradleManifest: 1
3540
focusAware: 1
3641
requiresSystemKeyboard: 0
3742
experimentalFeaturesEnabled: 0
3843
insightPassthroughEnabled: 0
3944
_insightPassthroughSupport: 2
4045
_processorFavor: 0
41-
systemSplashScreen: {fileID: 2800000, guid: f509394a4ac02d040a05f0b5ca22edc6, type: 3}
46+
systemSplashScreen: {fileID: 0}
4247
systemSplashScreenType: 0
4348
_systemLoadingScreenBackground: 1
44-
ovrPluginMd5Win64: aa662cdf2f901973cc80422bf87a766dd2e4bafd782b1156bbd5ba92f430892e
45-
ovrPluginMd5Android: b191da349d7c05c640e5f41721d8abdf75e3d4c6e5b2aa9a5e4789fa8807be29

Assets/Phanto/Audio/Scripts/PhantoGooSfxManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ public void PlayPhantomHopSfx(Vector3 point)
355355
return;
356356
}
357357

358-
var label = semanticClassification.Labels[0];
358+
var label = semanticClassification.Label.ToString();
359359

360360
if (string.IsNullOrEmpty(label) || !_semanticSfxDictionary.TryGetValue(label, out var queue))
361361
{

Assets/Phanto/Audio/Scripts/ResizeRoomAcoustics.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Copyright (c) Meta Platforms, Inc. and affiliates.
22

3+
using Meta.XR.MRUtilityKit;
34
using Phanto.Enemies.DebugScripts;
45
using Phantom.Environment.Scripts;
56
using PhantoUtils;
@@ -46,7 +47,7 @@ private void OnValidate()
4647
}
4748
#endif
4849

49-
private void OnBoundsChanged(OVRSceneRoom room, Bounds bounds)
50+
private void OnBoundsChanged(MRUKRoom room, Bounds bounds)
5051
{
5152
_debugBounds = bounds;
5253
transform.position = bounds.center;

Assets/Phanto/Audio/Scripts/SemanticSoundMapCollection.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
using System;
44
using System.Collections.Generic;
5+
using System.Linq;
6+
using Meta.XR.MRUtilityKit;
57
using UnityEngine;
68

79
namespace Phanto.Audio.Scripts
@@ -33,7 +35,7 @@ private void OnValidate()
3335
}
3436
}
3537

36-
foreach (var classString in OVRSceneManager.Classification.List)
38+
foreach (var classString in Enum.GetNames(typeof(MRUKAnchor.SceneLabels)).ToList())
3739
{
3840
// Skip entries we don't care about.
3941
if (classString == "DESK" || classString == "GLOBAL_MESH")

Assets/Phanto/CameraRig/Prefabs/GameCameraRig.prefab

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ MonoBehaviour:
9393
cameraRig: {fileID: 4300710967103994000}
9494
maxShift: 0.05
9595
maxRotation: 5
96-
axisAlignFloor: 1
96+
axisAlignFloor: 0
9797
--- !u!114 &645322443031245477
9898
MonoBehaviour:
9999
m_ObjectHideFlags: 0
@@ -735,6 +735,9 @@ MonoBehaviour:
735735
overridePerLayerColorScaleAndOffset: 0
736736
colorScale: {x: 1, y: 1, z: 1, w: 1}
737737
colorOffset: {x: 0, y: 0, z: 0, w: 0}
738+
passthroughLayerResumed:
739+
m_PersistentCalls:
740+
m_Calls: []
738741
colorMapEditorType_: 0
739742
colorMapEditorGradient:
740743
serializedVersion: 2

Assets/Phanto/Enemies/Phantom/Scripts/CrystalRangedTarget.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System;
44
using System.Collections;
55
using System.Collections.Generic;
6+
using Meta.XR.MRUtilityKit;
67
using PhantoUtils;
78
using UnityEngine;
89
using UnityEngine.Assertions;
@@ -17,7 +18,7 @@ public class CrystalRangedTarget : RangedFurnitureTarget, ICrystalTarget
1718
[SerializeField] private Crystal cornerCrystal;
1819
[SerializeField] private GameObject portalQuad;
1920

20-
private OVRScenePlane _scenePlane;
21+
private MRUKAnchor _scenePlane;
2122

2223
private Transform _transform;
2324

@@ -37,12 +38,12 @@ private void OnDestroy()
3738
DestroyCrystals();
3839
}
3940

40-
public override void Initialize(OVRSemanticClassification classification, OVRSceneRoom room)
41+
public override void Initialize(MRUKAnchor classification, MRUKRoom room)
4142
{
4243
_semanticClassification = classification;
4344
_transform = transform;
4445

45-
gameObject.SetSuffix($"{classification.Labels[0]}_{(ushort)gameObject.GetInstanceID():X4}");
46+
gameObject.SetSuffix($"{classification.Label.ToString()}_{(ushort)gameObject.GetInstanceID():X4}");
4647
classification.GetComponentsInChildren(true, _colliders);
4748
Register(this, _colliders);
4849

@@ -149,16 +150,16 @@ private void ResetCrystal()
149150
Activate(false);
150151
}
151152

152-
private void SpawnCrystals(OVRSceneRoom room)
153+
private void SpawnCrystals(MRUKRoom room)
153154
{
154155
Assert.IsNotNull(_transform);
155156
Assert.IsNotNull(_scenePlane);
156-
Assert.IsTrue(_scenePlane.Boundary.Count != 0);
157+
Assert.IsTrue(_scenePlane.PlaneBoundary2D.Count != 0);
157158

158159
var forward = _transform.forward;
159160
var origin = _transform.position - (forward * 0.03f);
160161

161-
var boundary = _scenePlane.Boundary;
162+
var boundary = _scenePlane.PlaneBoundary2D;
162163
var count = boundary.Count;
163164

164165
var offset = Vector3.zero;

Assets/Phanto/Enemies/Phantom/Scripts/PhantomBehaviour.cs

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Collections;
44
using System.Collections.Generic;
55
using System.Runtime.CompilerServices;
6+
using Meta.XR.MRUtilityKit;
67
using Phanto;
78
using Phanto.Audio.Scripts;
89
using Phanto.Enemies.DebugScripts;
@@ -719,14 +720,14 @@ private void PlayEmote(Thought thought)
719720
private void ShowTargetThought(PhantomTarget target)
720721
{
721722
Thought thought = Thought.None;
722-
string label = null;
723+
MRUKAnchor.SceneLabels label = MRUKAnchor.SceneLabels.OTHER;
723724

724725
switch (target)
725726
{
726727
case PhantomChaseTarget chaseTarget:
727728
if (SceneQuery.TryGetClosestSemanticClassification(chaseTarget.GetAttackPoint(), Vector3.up, out var classification))
728729
{
729-
label = classification.Labels[0];
730+
label = classification.Label;
730731
}
731732
break;
732733
case RangedFurnitureTarget furnitureTarget:
@@ -739,37 +740,37 @@ private void ShowTargetThought(PhantomTarget target)
739740

740741
switch (label)
741742
{
742-
case OVRSceneManager.Classification.Couch:
743+
case MRUKAnchor.SceneLabels.COUCH:
743744
thought = Thought.Couch;
744745
break;
745-
case OVRSceneManager.Classification.Other:
746+
case MRUKAnchor.SceneLabels.OTHER:
746747
thought = Thought.Other;
747748
break;
748-
case OVRSceneManager.Classification.Storage:
749+
case MRUKAnchor.SceneLabels.STORAGE:
749750
thought = Thought.Storage;
750751
break;
751-
case OVRSceneManager.Classification.Bed:
752+
case MRUKAnchor.SceneLabels.BED:
752753
thought = Thought.Bed;
753754
break;
754-
case OVRSceneManager.Classification.Table:
755+
case MRUKAnchor.SceneLabels.TABLE:
755756
thought = Thought.Table;
756757
break;
757-
case OVRSceneManager.Classification.DoorFrame:
758+
case MRUKAnchor.SceneLabels.DOOR_FRAME:
758759
thought = Thought.Door;
759760
break;
760-
case OVRSceneManager.Classification.WindowFrame:
761+
case MRUKAnchor.SceneLabels.WINDOW_FRAME:
761762
thought = Thought.Window;
762763
break;
763-
case OVRSceneManager.Classification.Screen:
764+
case MRUKAnchor.SceneLabels.SCREEN:
764765
thought = Thought.Screen;
765766
break;
766-
case OVRSceneManager.Classification.Lamp:
767+
case MRUKAnchor.SceneLabels.LAMP:
767768
thought = Thought.Lamp;
768769
break;
769-
case OVRSceneManager.Classification.Plant:
770+
case MRUKAnchor.SceneLabels.PLANT:
770771
thought = Thought.Plant;
771772
break;
772-
case OVRSceneManager.Classification.WallArt:
773+
case MRUKAnchor.SceneLabels.WALL_ART:
773774
thought = Thought.WallArt;
774775
break;
775776
default:

0 commit comments

Comments
 (0)