From 37c11b88b25e8ff4d3ee03cf1e57a9c81a288f0c Mon Sep 17 00:00:00 2001 From: cbrown Date: Wed, 17 Apr 2024 10:11:13 -0400 Subject: [PATCH] TrackedImages: Sample scene for multiple tracked images --- .../XREnvironment/ImageTracking.prefab | 6 +- .../ReferenceImageLibrary.asset | 14 +- .../Scenes/Samples/Prefabs/qr-code-01.prefab | 101 +- .../Scenes/Samples/Prefabs/qr-code-02.prefab | 99 +- Assets/Scenes/Samples/QRCodeLoading.unity | 926 +++++++++++++++++- Assets/Scripts/AR/Extensions.meta | 8 + .../AR/Extensions/XROriginExtensions.cs | 95 ++ .../AR/Extensions/XROriginExtensions.cs.meta | 11 + Assets/Scripts/AR/TrackedImageChanged.cs | 191 ++-- Assets/Scripts/TransformTracker.cs | 27 + Assets/Scripts/TransformTracker.cs.meta | 11 + ProjectSettings/EditorSettings.asset | 24 +- 12 files changed, 1367 insertions(+), 146 deletions(-) create mode 100644 Assets/Scripts/AR/Extensions.meta create mode 100644 Assets/Scripts/AR/Extensions/XROriginExtensions.cs create mode 100644 Assets/Scripts/AR/Extensions/XROriginExtensions.cs.meta create mode 100644 Assets/Scripts/TransformTracker.cs create mode 100644 Assets/Scripts/TransformTracker.cs.meta diff --git a/Assets/Prefabs/XREnvironment/ImageTracking.prefab b/Assets/Prefabs/XREnvironment/ImageTracking.prefab index 2f6c125f..0836df73 100644 --- a/Assets/Prefabs/XREnvironment/ImageTracking.prefab +++ b/Assets/Prefabs/XREnvironment/ImageTracking.prefab @@ -562,11 +562,11 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_CameraStartingPose: - position: {x: 0.22, y: 0.9345944, z: -0.21} - rotation: {x: -0.16794881, y: 0.414527, z: -0.078137435, w: -0.8909855} + position: {x: 0, y: 1.1176, z: 0} + rotation: {x: 0, y: 0, z: 0, w: 1} m_CameraMovementBounds: m_Center: {x: 0.044999838, y: 0.545, z: 0.00000011920929} - m_Extent: {x: 1.3000004, y: 0.5500002, z: 1.2500005} + m_Extent: {x: 1.3000004, y: 1, z: 1.2500005} m_DefaultViewPose: position: {x: 0, y: 1.0609863, z: -1.5} rotation: {x: -0.16100603, y: 0.1567927, z: -0.025916385, w: -0.97407466} diff --git a/Assets/References/ImageLibraries/ReferenceImageLibrary.asset b/Assets/References/ImageLibraries/ReferenceImageLibrary.asset index c7dcd972..9d9818b6 100644 --- a/Assets/References/ImageLibraries/ReferenceImageLibrary.asset +++ b/Assets/References/ImageLibraries/ReferenceImageLibrary.asset @@ -23,19 +23,17 @@ MonoBehaviour: m_SerializedTextureGuid: m_GuidLow: 9512191862091720473 m_GuidHigh: 4777916657343582074 - m_Size: {x: 0, y: 0} - m_SpecifySize: 0 + m_Size: {x: 0.1, y: 0.1} + m_SpecifySize: 1 m_Name: qr-code-01 - m_Texture: {fileID: 6192944022281365145, guid: cf56a719181984027acf62a7e2914e42, - type: 3} + m_Texture: {fileID: 0} - m_SerializedGuid: m_GuidLow: 5000005727017362315 m_GuidHigh: 17579163435370083502 m_SerializedTextureGuid: m_GuidLow: 8415066286968600214 m_GuidHigh: 355843442228713881 - m_Size: {x: 0, y: 0} - m_SpecifySize: 0 + m_Size: {x: 0.1, y: 0.1} + m_SpecifySize: 1 m_Name: qr-code-02 - m_Texture: {fileID: 6192944022281365145, guid: fc20f696523374c899d9b1b1b935f004, - type: 3} + m_Texture: {fileID: 0} diff --git a/Assets/Scenes/Samples/Prefabs/qr-code-01.prefab b/Assets/Scenes/Samples/Prefabs/qr-code-01.prefab index 1c88a352..1bbaf01b 100644 --- a/Assets/Scenes/Samples/Prefabs/qr-code-01.prefab +++ b/Assets/Scenes/Samples/Prefabs/qr-code-01.prefab @@ -30,7 +30,7 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 + m_ConstrainProportionsScale: 1 m_Children: [] m_Father: {fileID: 1119266294257528679} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -131,11 +131,12 @@ Transform: m_GameObject: {fileID: 7740556873076377330} serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0.939, y: 0, z: 2.135} - m_LocalScale: {x: 0.2, y: 0.2, z: 0.2} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 1 m_Children: - {fileID: 6463251211347540605} + - {fileID: 1629418972370686959} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &2974374142263200146 @@ -151,3 +152,97 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_DestroyOnRemoval: 1 +--- !u!1001 &1231279924666610692 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 1119266294257528679} + m_Modifications: + - target: {fileID: -8679921383154817045, guid: c8389a6832c69794daffd97728da0cb9, + type: 3} + propertyPath: m_LocalScale.x + value: 35 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: c8389a6832c69794daffd97728da0cb9, + type: 3} + propertyPath: m_LocalScale.y + value: 35 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: c8389a6832c69794daffd97728da0cb9, + type: 3} + propertyPath: m_LocalScale.z + value: 35 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: c8389a6832c69794daffd97728da0cb9, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: c8389a6832c69794daffd97728da0cb9, + type: 3} + propertyPath: m_LocalPosition.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: c8389a6832c69794daffd97728da0cb9, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: c8389a6832c69794daffd97728da0cb9, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.50008726 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: c8389a6832c69794daffd97728da0cb9, + type: 3} + propertyPath: m_LocalRotation.x + value: -0.49991274 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: c8389a6832c69794daffd97728da0cb9, + type: 3} + propertyPath: m_LocalRotation.y + value: 0.50008726 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: c8389a6832c69794daffd97728da0cb9, + type: 3} + propertyPath: m_LocalRotation.z + value: 0.49991274 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: c8389a6832c69794daffd97728da0cb9, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -89.98 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: c8389a6832c69794daffd97728da0cb9, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 90 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: c8389a6832c69794daffd97728da0cb9, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: c8389a6832c69794daffd97728da0cb9, + type: 3} + propertyPath: m_ConstrainProportionsScale + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 919132149155446097, guid: c8389a6832c69794daffd97728da0cb9, + type: 3} + propertyPath: m_Name + value: 3D RightArrow + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: c8389a6832c69794daffd97728da0cb9, type: 3} +--- !u!4 &1629418972370686959 stripped +Transform: + m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: c8389a6832c69794daffd97728da0cb9, + type: 3} + m_PrefabInstance: {fileID: 1231279924666610692} + m_PrefabAsset: {fileID: 0} diff --git a/Assets/Scenes/Samples/Prefabs/qr-code-02.prefab b/Assets/Scenes/Samples/Prefabs/qr-code-02.prefab index 7853919e..689dc6ea 100644 --- a/Assets/Scenes/Samples/Prefabs/qr-code-02.prefab +++ b/Assets/Scenes/Samples/Prefabs/qr-code-02.prefab @@ -26,11 +26,12 @@ Transform: m_GameObject: {fileID: 2334735618901841031} serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0.939, y: 0, z: 2.135} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: - {fileID: 507655295618772503} + - {fileID: 7610384848938991257} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &6628545826349043593 @@ -75,7 +76,7 @@ Transform: serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0.2, y: 0.2, z: 0.2} + m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 1 m_Children: [] m_Father: {fileID: 7368655793651849036} @@ -151,3 +152,97 @@ SphereCollider: serializedVersion: 3 m_Radius: 0.5 m_Center: {x: 0, y: 0, z: 0} +--- !u!1001 &7932877230784944498 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 7368655793651849036} + m_Modifications: + - target: {fileID: -8679921383154817045, guid: c8389a6832c69794daffd97728da0cb9, + type: 3} + propertyPath: m_LocalScale.x + value: 35 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: c8389a6832c69794daffd97728da0cb9, + type: 3} + propertyPath: m_LocalScale.y + value: 35 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: c8389a6832c69794daffd97728da0cb9, + type: 3} + propertyPath: m_LocalScale.z + value: 35 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: c8389a6832c69794daffd97728da0cb9, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: c8389a6832c69794daffd97728da0cb9, + type: 3} + propertyPath: m_LocalPosition.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: c8389a6832c69794daffd97728da0cb9, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: c8389a6832c69794daffd97728da0cb9, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.50008726 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: c8389a6832c69794daffd97728da0cb9, + type: 3} + propertyPath: m_LocalRotation.x + value: -0.49991274 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: c8389a6832c69794daffd97728da0cb9, + type: 3} + propertyPath: m_LocalRotation.y + value: 0.50008726 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: c8389a6832c69794daffd97728da0cb9, + type: 3} + propertyPath: m_LocalRotation.z + value: 0.49991274 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: c8389a6832c69794daffd97728da0cb9, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: -89.98 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: c8389a6832c69794daffd97728da0cb9, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 90 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: c8389a6832c69794daffd97728da0cb9, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: c8389a6832c69794daffd97728da0cb9, + type: 3} + propertyPath: m_ConstrainProportionsScale + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 919132149155446097, guid: c8389a6832c69794daffd97728da0cb9, + type: 3} + propertyPath: m_Name + value: 3D RightArrow + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: c8389a6832c69794daffd97728da0cb9, type: 3} +--- !u!4 &7610384848938991257 stripped +Transform: + m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: c8389a6832c69794daffd97728da0cb9, + type: 3} + m_PrefabInstance: {fileID: 7932877230784944498} + m_PrefabAsset: {fileID: 0} diff --git a/Assets/Scenes/Samples/QRCodeLoading.unity b/Assets/Scenes/Samples/QRCodeLoading.unity index a4b03ed5..a31739e0 100644 --- a/Assets/Scenes/Samples/QRCodeLoading.unity +++ b/Assets/Scenes/Samples/QRCodeLoading.unity @@ -788,6 +788,7 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 405067318} + - component: {fileID: 405067319} m_Layer: 0 m_Name: Camera Offset m_TagString: Untagged @@ -813,6 +814,186 @@ Transform: - {fileID: 363252610} m_Father: {fileID: 741148540} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &405067319 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 405067317} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e36d5b65f0ec847c8aaa6bd34616f053, type: 3} + m_Name: + m_EditorClassIdentifier: + target: {fileID: 0} + output: {fileID: 626644880} +--- !u!1 &626644878 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 626644879} + - component: {fileID: 626644881} + - component: {fileID: 626644880} + m_Layer: 5 + m_Name: CameraOffset (TMP) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &626644879 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 626644878} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1465962732} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 1707.5, y: -1024} + m_SizeDelta: {x: 683, y: 2048} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &626644880 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 626644878} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: New Text + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 36 + m_fontSizeBase: 36 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &626644881 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 626644878} + m_CullTransparentMesh: 1 +--- !u!1 &727433014 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 727433015} + m_Layer: 0 + m_Name: Debug UI + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!4 &727433015 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 727433014} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1743547435} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &741148537 GameObject: m_ObjectHideFlags: 0 @@ -825,7 +1006,7 @@ GameObject: - component: {fileID: 741148539} - component: {fileID: 741148538} - component: {fileID: 741148541} - - component: {fileID: 741148542} + - component: {fileID: 741148543} m_Layer: 0 m_Name: XR Origin (XR Rig) m_TagString: Untagged @@ -873,7 +1054,7 @@ Transform: m_GameObject: {fileID: 741148537} serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0.939, y: 0, z: 2.135} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: @@ -896,7 +1077,7 @@ MonoBehaviour: type: 2} m_MaxNumberOfMovingImages: 4 m_TrackedImagePrefab: {fileID: 0} ---- !u!114 &741148542 +--- !u!114 &741148543 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -905,30 +1086,145 @@ MonoBehaviour: m_GameObject: {fileID: 741148537} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: ecb22d2c87e61499cbc8fdc37392f22e, type: 3} + m_Script: {fileID: 11500000, guid: e36d5b65f0ec847c8aaa6bd34616f053, type: 3} m_Name: m_EditorClassIdentifier: - m_TrackedImageManager: {fileID: 741148541} - _arTrackedImagePrefabs: - - {fileID: 2974374142263200146, guid: b73edfe639a9a4a47b6e79771966340e, type: 3} - - {fileID: 6628545826349043593, guid: 68c0123ace53447999be0bd00b55e09e, type: 3} - m_DebugListImages: - m_Name: Debug List Images - m_Type: 0 - m_ExpectedControlType: - m_Id: 36ba061f-f65f-4dec-b0ef-cbf4392cebd0 - m_Processors: - m_Interactions: - m_SingletonActionBindings: - - m_Name: - m_Id: 105af239-d364-4bce-836a-6ac3ee72ebb8 - m_Path: /tab - m_Interactions: - m_Processors: - m_Groups: - m_Action: Debug List Images - m_Flags: 0 - m_Flags: 0 + target: {fileID: 0} + output: {fileID: 1454802596} +--- !u!1 &833688781 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 833688782} + - component: {fileID: 833688784} + - component: {fileID: 833688783} + m_Layer: 5 + m_Name: MainCamera (TMP) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &833688782 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 833688781} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1465962732} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 2390.5, y: -1024} + m_SizeDelta: {x: 683, y: 2048} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &833688783 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 833688781} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: New Text + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 36 + m_fontSizeBase: 36 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &833688784 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 833688781} + m_CullTransparentMesh: 1 --- !u!1 &991310534 GameObject: m_ObjectHideFlags: 0 @@ -1585,6 +1881,95 @@ MonoBehaviour: m_Flags: 0 m_Reference: {fileID: 0} m_ButtonPressPoint: 0.5 +--- !u!1 &1082902068 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1082902071} + - component: {fileID: 1082902070} + - component: {fileID: 1082902072} + m_Layer: 0 + m_Name: EventSystem + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1082902070 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1082902068} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} + m_Name: + m_EditorClassIdentifier: + m_FirstSelected: {fileID: 0} + m_sendNavigationEvents: 1 + m_DragThreshold: 10 +--- !u!4 &1082902071 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1082902068} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1082902072 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1082902068} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 01614664b831546d2ae94a42149d80ac, type: 3} + m_Name: + m_EditorClassIdentifier: + m_SendPointerHoverToParent: 1 + m_MoveRepeatDelay: 0.5 + m_MoveRepeatRate: 0.1 + m_XRTrackingOrigin: {fileID: 0} + m_ActionsAsset: {fileID: -944628639613478452, guid: ca9f5fa95ffab41fb9a615ab714db018, + type: 3} + m_PointAction: {fileID: -1654692200621890270, guid: ca9f5fa95ffab41fb9a615ab714db018, + type: 3} + m_MoveAction: {fileID: -8784545083839296357, guid: ca9f5fa95ffab41fb9a615ab714db018, + type: 3} + m_SubmitAction: {fileID: 392368643174621059, guid: ca9f5fa95ffab41fb9a615ab714db018, + type: 3} + m_CancelAction: {fileID: 7727032971491509709, guid: ca9f5fa95ffab41fb9a615ab714db018, + type: 3} + m_LeftClickAction: {fileID: 3001919216989983466, guid: ca9f5fa95ffab41fb9a615ab714db018, + type: 3} + m_MiddleClickAction: {fileID: -2185481485913320682, guid: ca9f5fa95ffab41fb9a615ab714db018, + type: 3} + m_RightClickAction: {fileID: -4090225696740746782, guid: ca9f5fa95ffab41fb9a615ab714db018, + type: 3} + m_ScrollWheelAction: {fileID: 6240969308177333660, guid: ca9f5fa95ffab41fb9a615ab714db018, + type: 3} + m_TrackedDevicePositionAction: {fileID: 6564999863303420839, guid: ca9f5fa95ffab41fb9a615ab714db018, + type: 3} + m_TrackedDeviceOrientationAction: {fileID: 7970375526676320489, guid: ca9f5fa95ffab41fb9a615ab714db018, + type: 3} + m_DeselectOnBackgroundClick: 1 + m_PointerBehavior: 0 + m_CursorLockBehavior: 0 --- !u!1 &1106184369 GameObject: m_ObjectHideFlags: 0 @@ -1642,6 +2027,8 @@ GameObject: - component: {fileID: 1114330154} - component: {fileID: 1114330153} - component: {fileID: 1114330152} + - component: {fileID: 1114330155} + - component: {fileID: 1114330156} m_Layer: 0 m_Name: AR Session m_TagString: Untagged @@ -1685,12 +2072,482 @@ Transform: m_GameObject: {fileID: 1114330151} serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0.939, y: 0, z: 2.135} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1114330155 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1114330151} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e36d5b65f0ec847c8aaa6bd34616f053, type: 3} + m_Name: + m_EditorClassIdentifier: + target: {fileID: 0} + output: {fileID: 1471369615} +--- !u!114 &1114330156 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1114330151} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ecb22d2c87e61499cbc8fdc37392f22e, type: 3} + m_Name: + m_EditorClassIdentifier: + trackedImageManager: {fileID: 741148541} + arPrefabs: + - {fileID: 7740556873076377330, guid: b73edfe639a9a4a47b6e79771966340e, type: 3} + - {fileID: 2334735618901841031, guid: 68c0123ace53447999be0bd00b55e09e, type: 3} + scaleFactor: + x: 0.05 + y: 0.05 + z: 0.05 +--- !u!1 &1454802594 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1454802595} + - component: {fileID: 1454802597} + - component: {fileID: 1454802596} + m_Layer: 5 + m_Name: XROrigin (TMP) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1454802595 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1454802594} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1465962732} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 341.5, y: -1024} + m_SizeDelta: {x: 683, y: 2048} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1454802596 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1454802594} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: New Text + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 36 + m_fontSizeBase: 36 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &1454802597 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1454802594} + m_CullTransparentMesh: 1 +--- !u!1 &1465962731 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1465962732} + - component: {fileID: 1465962733} + m_Layer: 5 + m_Name: Container + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1465962732 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1465962731} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1454802595} + - {fileID: 1471369614} + - {fileID: 626644879} + - {fileID: 833688782} + m_Father: {fileID: 1743547435} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1465962733 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1465962731} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 0 + m_Bottom: 0 + m_ChildAlignment: 0 + m_Spacing: 0 + m_ChildForceExpandWidth: 1 + m_ChildForceExpandHeight: 1 + m_ChildControlWidth: 1 + m_ChildControlHeight: 1 + m_ChildScaleWidth: 0 + m_ChildScaleHeight: 0 + m_ReverseArrangement: 0 +--- !u!1 &1471369613 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1471369614} + - component: {fileID: 1471369616} + - component: {fileID: 1471369615} + m_Layer: 5 + m_Name: ARSession (TMP) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1471369614 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1471369613} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1465962732} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 1024.5, y: -1024} + m_SizeDelta: {x: 683, y: 2048} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1471369615 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1471369613} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: New Text + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 36 + m_fontSizeBase: 36 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &1471369616 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1471369613} + m_CullTransparentMesh: 1 +--- !u!1 &1743547434 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1743547435} + - component: {fileID: 1743547438} + - component: {fileID: 1743547437} + - component: {fileID: 1743547436} + m_Layer: 5 + m_Name: Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1743547435 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1743547434} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1465962732} + m_Father: {fileID: 727433015} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!114 &1743547436 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1743547434} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &1743547437 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1743547434} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 0 +--- !u!223 &1743547438 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1743547434} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_VertexColorAlwaysGammaSpace: 0 + m_AdditionalShaderChannelsFlag: 25 + m_UpdateRectTransformForStandalone: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 --- !u!1 &1821000983 GameObject: m_ObjectHideFlags: 0 @@ -1824,6 +2681,7 @@ GameObject: - component: {fileID: 2135227413} - component: {fileID: 2135227412} - component: {fileID: 2135227417} + - component: {fileID: 2135227418} m_Layer: 0 m_Name: Main Camera m_TagString: MainCamera @@ -2090,6 +2948,20 @@ MonoBehaviour: mipBias: 0 varianceClampScale: 0.9 contrastAdaptiveSharpening: 0 +--- !u!114 &2135227418 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2135227410} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e36d5b65f0ec847c8aaa6bd34616f053, type: 3} + m_Name: + m_EditorClassIdentifier: + target: {fileID: 0} + output: {fileID: 833688783} --- !u!1660057539 &9223372036854775807 SceneRoots: m_ObjectHideFlags: 0 @@ -2098,3 +2970,5 @@ SceneRoots: - {fileID: 1106184371} - {fileID: 741148540} - {fileID: 1114330154} + - {fileID: 727433015} + - {fileID: 1082902071} diff --git a/Assets/Scripts/AR/Extensions.meta b/Assets/Scripts/AR/Extensions.meta new file mode 100644 index 00000000..4fa59d0f --- /dev/null +++ b/Assets/Scripts/AR/Extensions.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e0e8618ff31454360ad62f1a57d5ff5c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/AR/Extensions/XROriginExtensions.cs b/Assets/Scripts/AR/Extensions/XROriginExtensions.cs new file mode 100644 index 00000000..bef69e0b --- /dev/null +++ b/Assets/Scripts/AR/Extensions/XROriginExtensions.cs @@ -0,0 +1,95 @@ +// NOTE: This is copied Unity Technologies' AR Foundation Samples project from GitHub (https://github.com/Unity-Technologies/arfoundation-samples/blob/main/Assets/Scripts/Runtime/XROriginExtensions.cs) +// The code may be modified to fit the need of the UDRI XRTeam's use-cases + +using System; +using Unity.XR.CoreUtils; +using UnityEngine; +using UnityEngine.XR.ARFoundation; + +// MODIFICATION: Namespace changed to fit within UDRI XRT's package namespace conventions +namespace MAVRIC.XR.ARFoundation.Extensions +{ + /// + /// This class contains extension methods suitable for replacing the ARSessionOrigin.MakeContentAppearAt + /// API as existed in AR Foundation 4.2, allowing users to upgrade projects from + /// to with continued access to this API. + /// + public static class XROriginExtensions + { + /// + /// Makes appear to be placed at with orientation . + /// + /// The XROrigin in the Scene. + /// The Transform of the content you wish to affect. + /// The position you wish the content to appear at. This could be + /// a position on a detected plane, for example. + /// The rotation the content should appear to be in, relative + /// to the Camera. + /// + /// This method does not actually change the Transform of content; instead, + /// it updates the XROrigin's Transform so the content + /// appears to be at the given position and rotation. This is useful for placing AR + /// content onto surfaces when the content itself cannot be moved at runtime. + /// For example, if your content includes terrain or a NavMesh, it cannot + /// be moved or rotated dynamically. + /// + public static void MakeContentAppearAt(this XROrigin origin, Transform content, Vector3 position, Quaternion rotation) + { + MakeContentAppearAt(origin, content, position); + MakeContentAppearAt(origin, content, rotation); + } + + /// + /// Makes appear to be placed at . + /// + /// The XROrigin in the Scene. + /// The Transform of the content you wish to affect. + /// The position you wish the content to appear at. This could be + /// a position on a detected plane, for example. + /// + /// This method does not actually change the Transform of content; instead, + /// it updates the XROrigin's Transform so the content + /// appears to be at the given position. + /// + public static void MakeContentAppearAt(this XROrigin origin, Transform content, Vector3 position) + { + if (content == null) + throw new ArgumentNullException(nameof(content)); + + var originTransform = origin.transform; + + // Adjust the Camera Offset transform to account + // for the actual position we want the content to appear at. + origin.CameraFloorOffsetObject.transform.position += originTransform.position - position; + + // The XROrigin's position needs to match the content's pivot. This is so + // the entire XROrigin rotates around the content (so the impression is that + // the content is rotating, not the rig). + originTransform.position = content.position; + } + + /// + /// Makes appear to have orientation relative to the Camera. + /// + /// The XROrigin in the Scene. + /// The Transform of the content you wish to affect. + /// The rotation the content should appear to be in, relative + /// to the Camera. + /// + /// This method does not actually change the Transform of content; instead, + /// it updates the XROrigin's Transform so that the content + /// appears to be in the requested orientation. + /// + public static void MakeContentAppearAt(this XROrigin origin, Transform content, Quaternion rotation) + { + if (content == null) + throw new ArgumentNullException(nameof(content)); + + // Since we aren't rotating the content, we need to perform the inverse + // operation on the XROrigin. For example, if we want the + // content to appear to be rotated 90 degrees on the Y axis, we should + // rotate our rig -90 degrees on the Y axis. + origin.transform.rotation = Quaternion.Inverse(rotation) * content.rotation; + } + } +} diff --git a/Assets/Scripts/AR/Extensions/XROriginExtensions.cs.meta b/Assets/Scripts/AR/Extensions/XROriginExtensions.cs.meta new file mode 100644 index 00000000..9eb8af1e --- /dev/null +++ b/Assets/Scripts/AR/Extensions/XROriginExtensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4a513f970b04541f288e351b19ab10ac +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/AR/TrackedImageChanged.cs b/Assets/Scripts/AR/TrackedImageChanged.cs index 5477784e..5483cf7e 100644 --- a/Assets/Scripts/AR/TrackedImageChanged.cs +++ b/Assets/Scripts/AR/TrackedImageChanged.cs @@ -1,124 +1,119 @@ -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.InputSystem; -using UnityEngine.XR.ARFoundation; -using UnityEngine.XR.ARSubsystems; +// NOTE: Taken from https://github.com/dilmerv/UnityARFoundationEssentials/blob/master/Assets/Scripts/TrackedImageInfoMultipleManager.cs +// This has been modified to fit the need of the UDRI XRTeam's use-cases -namespace AR +using System.Collections.Generic; +using System.Linq; +using Unity.Mathematics; +using UnityEngine; +using UnityEngine.XR.ARFoundation; + +namespace MAVRIC.GEEKCup.AR { public class TrackedImageChanged : MonoBehaviour - { - [SerializeField] ARTrackedImageManager m_TrackedImageManager; + { + [SerializeField] private ARTrackedImageManager trackedImageManager; + [SerializeField] private GameObject[] arPrefabs; - [SerializeField] private List _arTrackedImagePrefabs = new (); - - private List _spawned = new (); + [SerializeField] private float3 scaleFactor = new (0.1f, 0.1f, 0.1f); -#if UNITY_EDITOR - [Header("Debug")] - [SerializeField] private InputAction m_DebugListImages; -#endif + private Dictionary arObjects = new (); - void OnEnable() + private void Awake() { - m_TrackedImageManager.trackedImagesChanged += OnChange; + if (trackedImageManager == null) + { + if (!TryGetComponent(out trackedImageManager)) + { + Debug.LogError("Failed to find ARTrackedImageManager"); + } + } + } + + private void OnEnable() + { + if (trackedImageManager == null) return; -#if UNITY_EDITOR - m_DebugListImages.Enable(); - m_DebugListImages.performed += Debug_ListImages; -#endif - } - - void OnDisable() - { - m_TrackedImageManager.trackedImagesChanged -= OnChange; + trackedImageManager.trackedImagesChanged += OnTrackedImagesChanged; -#if UNITY_EDITOR - m_DebugListImages.performed -= Debug_ListImages; - m_DebugListImages.Disable(); -#endif + SpawnAllARObjects(); } - private void OnChange(ARTrackedImagesChangedEventArgs eventArgs) + + private void OnDisable() { - foreach (var newImage in eventArgs.added) + if (trackedImageManager == null) return; + + trackedImageManager.trackedImagesChanged -= OnTrackedImagesChanged; + + for (int i = arObjects.Keys.Count - 1; i >= 0; i--) { - // Handle added event - Debug.Log($"Added image: {newImage.referenceImage.name}"); - - foreach (var prefab in _arTrackedImagePrefabs) + var key = arObjects.Keys.ElementAt(i); + if (arObjects.Remove(key, out var value)) { - if (prefab.referenceImage.name.Equals(newImage.referenceImage.name)) - { - if (_spawned == null) - { - _spawned = new List(); - } - - // Spawn new object - Debug.Log("Spawning object..."); - _spawned.Add(Instantiate(prefab, newImage.transform)); - } - } - } - - foreach (var updatedImage in eventArgs.updated) - { - // Handle updated event - Debug.Log($"Updated image: {updatedImage.trackableId} - {updatedImage.trackingState}"); - - foreach (var spawnedObject in _spawned) - { - if (spawnedObject.trackableId == updatedImage.trackableId) - { - // Update position - Debug.Log("Updating position..."); - spawnedObject.transform.position = updatedImage.transform.position; - } - } - } - - foreach (var removedImage in eventArgs.removed) - { - // Handle removed event - Debug.Log($"Removed image: {removedImage.referenceImage.name}"); - - for (int i = _spawned.Count - 1; i >= 0; i--) - { - var spawnedObject = _spawned[i]; - - if (spawnedObject.trackableId == removedImage.trackableId) - { - // Handle object removal - Debug.Log("Removing object..."); - if (_spawned.Remove(spawnedObject)) - { - // Destroy object - Debug.Log("Destroying object..."); - Destroy(spawnedObject.gameObject); - } - } + Destroy(value); } } } - private void ListAllImages() + private void SpawnAllARObjects() { - Debug.Log( - $"There are {m_TrackedImageManager.trackables.count} images being tracked."); - - foreach (var trackedImage in m_TrackedImageManager.trackables) + // setup all game objects in dictionary + foreach (GameObject arObject in arPrefabs) { - Debug.Log($"Image: {trackedImage.referenceImage.name} is at " + - $"{trackedImage.transform.position}"); + GameObject newARObject = Instantiate(arObject, Vector3.zero, Quaternion.identity); + newARObject.SetActive(false); + + newARObject.name = arObject.name; + arObjects.Add(arObject.name, newARObject); } } - - private ARTrackedImage GetImageAt(TrackableId trackableId) + + private void OnTrackedImagesChanged(ARTrackedImagesChangedEventArgs eventArgs) { - return m_TrackedImageManager.trackables[trackableId]; + foreach (ARTrackedImage trackedImage in eventArgs.added) + { + UpdateARImage(trackedImage); + } + + foreach (ARTrackedImage trackedImage in eventArgs.updated) + { + UpdateARImage(trackedImage); + } + + foreach (ARTrackedImage trackedImage in eventArgs.removed) + { + arObjects[trackedImage.name].SetActive(false); + } } - private void Debug_ListImages(InputAction.CallbackContext _) => ListAllImages(); + private void UpdateARImage(ARTrackedImage trackedImage) + { + // Assign and Place Game Object + AssignGameObject(trackedImage.referenceImage.name, trackedImage.transform.position, scaleFactor, trackedImage.transform.rotation); + + Debug.Log($"trackedImage.referenceImage.name: {trackedImage.referenceImage.name}"); + } + + private void AssignGameObject(string name, Vector3 newPosition, Vector3 newScale, Quaternion newRotation) + { + if (arPrefabs != null) + { + GameObject goARObject = arObjects[name]; + goARObject.SetActive(true); + + goARObject.transform.position = newPosition; + goARObject.transform.localScale = newScale; + goARObject.transform.localRotation = newRotation; + + foreach (GameObject go in arObjects.Values) + { + Debug.Log($"Go in arObjects.Values: {go.name}"); + if (go.name != name) + { + go.SetActive(false); + } + } + } + } } -} +} \ No newline at end of file diff --git a/Assets/Scripts/TransformTracker.cs b/Assets/Scripts/TransformTracker.cs new file mode 100644 index 00000000..614609d1 --- /dev/null +++ b/Assets/Scripts/TransformTracker.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using TMPro; +using UnityEngine; + +namespace MAVRIC.GEEKCup +{ + public class TransformTracker : MonoBehaviour + { + public Transform target; + public TMP_Text output; + + private void Awake() + { + if (target == null) + { + target = transform; + } + } + + private void Update() + { + output.text = JsonUtility.ToJson(target.position, true); + } + } +} diff --git a/Assets/Scripts/TransformTracker.cs.meta b/Assets/Scripts/TransformTracker.cs.meta new file mode 100644 index 00000000..af40cd19 --- /dev/null +++ b/Assets/Scripts/TransformTracker.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e36d5b65f0ec847c8aaa6bd34616f053 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/ProjectSettings/EditorSettings.asset b/ProjectSettings/EditorSettings.asset index c8da44ea..28793834 100644 --- a/ProjectSettings/EditorSettings.asset +++ b/ProjectSettings/EditorSettings.asset @@ -3,33 +3,45 @@ --- !u!159 &1 EditorSettings: m_ObjectHideFlags: 0 - serializedVersion: 9 - m_ExternalVersionControlSupport: Visible Meta Files + serializedVersion: 12 m_SerializationMode: 2 m_LineEndingsForNewScripts: 2 m_DefaultBehaviorMode: 0 m_PrefabRegularEnvironment: {fileID: 0} m_PrefabUIEnvironment: {fileID: 0} m_SpritePackerMode: 0 + m_SpritePackerCacheSize: 10 m_SpritePackerPaddingPower: 1 + m_Bc7TextureCompressor: 0 m_EtcTextureCompressorBehavior: 1 m_EtcTextureFastCompressor: 1 m_EtcTextureNormalCompressor: 2 m_EtcTextureBestCompressor: 4 m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;asmref;rsp - m_ProjectGenerationRootNamespace: - m_CollabEditorSettings: - inProgressEnabled: 1 + m_ProjectGenerationRootNamespace: MAVRIC.GEEKCup m_EnableTextureStreamingInEditMode: 1 m_EnableTextureStreamingInPlayMode: 1 + m_EnableEditorAsyncCPUTextureLoading: 0 m_AsyncShaderCompilation: 1 + m_PrefabModeAllowAutoSave: 1 m_EnterPlayModeOptionsEnabled: 0 m_EnterPlayModeOptions: 3 - m_ShowLightmapResolutionOverlay: 1 + m_GameObjectNamingDigits: 1 + m_GameObjectNamingScheme: 0 + m_AssetNamingUsesSpace: 1 + m_InspectorUseIMGUIDefaultInspector: 0 m_UseLegacyProbeSampleCount: 0 + m_SerializeInlineMappingsOnOneLine: 0 + m_DisableCookiesInLightmapper: 1 m_AssetPipelineMode: 1 + m_RefreshImportMode: 0 m_CacheServerMode: 0 m_CacheServerEndpoint: m_CacheServerNamespacePrefix: default m_CacheServerEnableDownload: 1 m_CacheServerEnableUpload: 1 + m_CacheServerEnableAuth: 0 + m_CacheServerEnableTls: 0 + m_CacheServerValidationMode: 2 + m_CacheServerDownloadBatchSize: 128 + m_EnableEnlightenBakedGI: 0