浏览代码

Merge branch 'latest-preview' into Multi-image

/4.1
Shan Jiang 4 年前
当前提交
b52a295b
共有 16 个文件被更改,包括 1521 次插入483 次删除
  1. 519
      Assets/Scenes/ARFoundationMenu/Menu.unity
  2. 5
      Assets/Scripts/UX/ARSceneSelectUI.cs
  3. 9
      Assets/Scripts/UX/CheckAvailableFeatures.cs
  4. 3
      ProjectSettings/EditorBuildSettings.asset
  5. 8
      Assets/Scenes/Configurations.meta
  6. 41
      Assets/Scripts/CameraSwapper.cs
  7. 11
      Assets/Scripts/CameraSwapper.cs.meta
  8. 141
      Assets/Scripts/CustomConfigurationChooser.cs
  9. 11
      Assets/Scripts/CustomConfigurationChooser.cs.meta
  10. 166
      Assets/Scripts/DisplayARSessionInformation.cs
  11. 11
      Assets/Scripts/DisplayARSessionInformation.cs.meta
  12. 7
      Assets/Scenes/Configurations/ConfigurationChooser.unity.meta
  13. 63
      Assets/Scenes/Configurations/ConfigurationChooserSettings.lighting
  14. 8
      Assets/Scenes/Configurations/ConfigurationChooserSettings.lighting.meta
  15. 1001
      Assets/Scenes/Configurations/ConfigurationChooser.unity

519
Assets/Scenes/ARFoundationMenu/Menu.unity


m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 375968640}
m_CullTransparentMesh: 0
--- !u!1 &420944458
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 420944459}
- component: {fileID: 420944462}
- component: {fileID: 420944461}
- component: {fileID: 420944460}
m_Layer: 5
m_Name: Basic Image Tracking
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &420944459
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 420944458}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 2.8957999, y: 2.8957999, z: 2.8957999}
m_Children:
- {fileID: 1196527568}
m_Father: {fileID: 1419347570}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 125}
m_SizeDelta: {x: 230, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &420944460
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 420944458}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 420944461}
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 774532498}
m_TargetAssemblyTypeName: UnityEngine.XR.ARFoundation.Samples.ARSceneSelectUI,
Assembly-CSharp
m_MethodName: BasicImageTrackingButtonPressed
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &420944461
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 420944458}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, 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_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!222 &420944462
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 420944458}
m_CullTransparentMesh: 0
--- !u!1 &505624362
GameObject:
m_ObjectHideFlags: 0

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 599612841}
m_CullTransparentMesh: 0
--- !u!1 &604663682
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 604663683}
- component: {fileID: 604663685}
- component: {fileID: 604663684}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &604663683
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 604663682}
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_Children: []
m_Father: {fileID: 960377358}
m_RootOrder: 0
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 &604663684
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 604663682}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, 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_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 14
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: Back
--- !u!222 &604663685
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 604663682}
m_CullTransparentMesh: 0
--- !u!1 &622634201
GameObject:
m_ObjectHideFlags: 0

m_Name:
m_EditorClassIdentifier:
m_AllMenu: {fileID: 1569808630}
m_ImageTrackingMenu: {fileID: 1419347569}
m_FaceTrackingMenu: {fileID: 881193863}
m_BodyTrackingMenu: {fileID: 1468820548}
m_PlaneDetectionMenu: {fileID: 881169046}

m_SampleUX: {fileID: 1783746788}
m_CheckSupport: {fileID: 912198813}
m_Depth: {fileID: 251164954}
m_ConfigChooser: {fileID: 2011106401}
--- !u!1 &786358435
GameObject:
m_ObjectHideFlags: 0

- {fileID: 191336338}
- {fileID: 1334242982}
m_Father: {fileID: 1413559114}
m_RootOrder: 4
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}

- {fileID: 375968641}
- {fileID: 531148337}
m_Father: {fileID: 1413559114}
m_RootOrder: 2
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 958481429}
m_CullTransparentMesh: 0
--- !u!1 &960377357
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 960377358}
- component: {fileID: 960377361}
- component: {fileID: 960377360}
- component: {fileID: 960377359}
m_Layer: 5
m_Name: BackButton
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &960377358
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 960377357}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 2.8957975, y: 2.8957975, z: 2.8957975}
m_Children:
- {fileID: 604663683}
m_Father: {fileID: 1419347570}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.8, y: 0.15}
m_AnchorMax: {x: 0.8, y: 0.15}
m_AnchoredPosition: {x: 498.00012, y: -333.42514}
m_SizeDelta: {x: 50, y: 50}
m_Pivot: {x: 1, y: 0}
--- !u!114 &960377359
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 960377357}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 960377360}
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 774532498}
m_TargetAssemblyTypeName:
m_MethodName: BackButtonPressed
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &960377360
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 960377357}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, 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_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!222 &960377361
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 960377357}
m_CullTransparentMesh: 0
--- !u!1 &980252438
GameObject:
m_ObjectHideFlags: 0

- {fileID: 533534994}
- {fileID: 92576475}
m_Father: {fileID: 1413559114}
m_RootOrder: 6
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}

m_Name:
m_EditorClassIdentifier:
m_Tooltip: {fileID: 2094799242}
--- !u!1 &1196527567
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1196527568}
- component: {fileID: 1196527570}
- component: {fileID: 1196527569}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1196527568
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1196527567}
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_Children: []
m_Father: {fileID: 420944459}
m_RootOrder: 0
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 &1196527569
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1196527567}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, 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_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 14
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: Basic Image Tracking
--- !u!222 &1196527570
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1196527567}
m_CullTransparentMesh: 0
--- !u!1 &1196848406
GameObject:
m_ObjectHideFlags: 0

m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1569808631}
- {fileID: 1419347570}
- {fileID: 881193864}
- {fileID: 1468820549}
- {fileID: 881169047}

m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0.000015258789, y: 0.000030517578}
m_AnchoredPosition: {x: 0.000015258789, y: 0.00007243082}
m_SizeDelta: {x: 0, y: 1100}
m_Pivot: {x: 0, y: 1}
--- !u!1 &1416737520

m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1419347569
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1419347570}
m_Layer: 5
m_Name: ImageTrackingScenes
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!224 &1419347570
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1419347569}
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_Children:
- {fileID: 960377358}
- {fileID: 420944459}
- {fileID: 2011106399}
m_Father: {fileID: 1413559114}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 149.99998}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &1459382204
GameObject:
m_ObjectHideFlags: 0

- {fileID: 1356389282}
- {fileID: 368937169}
m_Father: {fileID: 1413559114}
m_RootOrder: 3
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}

m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: Image Tracking With Multiple Prefabs
m_Text: Config Chooser
--- !u!222 &1555465368
CanvasRenderer:
m_ObjectHideFlags: 0

- {fileID: 1783746786}
- {fileID: 912198811}
- {fileID: 251164958}
- {fileID: 2011106399}
m_Father: {fileID: 1413559114}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

m_TargetGraphic: {fileID: 1130901186}
m_HandleRect: {fileID: 1130901185}
m_Direction: 2
m_Value: 0
m_Size: 1
m_Value: 0.9999998
m_Size: 0.37014005
m_NumberOfSteps: 0
m_OnValueChanged:
m_PersistentCalls:

- {fileID: 1327219897}
- {fileID: 541752378}
m_Father: {fileID: 1413559114}
m_RootOrder: 5
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}

serializedVersion: 6
m_Component:
- component: {fileID: 2011106399}
- component: {fileID: 2011106403}
m_Name: Image Tracking With Multiple Prefabs
m_Name: Configuration Chooser
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0

m_GameObject: {fileID: 2011106398}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 2.8957999, y: 2.8957999, z: 2.8957999}
m_LocalScale: {x: 2.8958, y: 2.8958, z: 2.8958}
m_Father: {fileID: 1419347570}
m_RootOrder: 2
m_Father: {fileID: 1569808631}
m_RootOrder: 21
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 230, y: 30}
m_AnchoredPosition: {x: 0, y: -650}
m_SizeDelta: {x: 110, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &2011106400
MonoBehaviour:

m_GameObject: {fileID: 2011106398}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 16733cd6749cf4d96be9df0329c6938a, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Tooltip: {fileID: 2094799242}
--- !u!114 &2011106401
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2011106398}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:

m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 2011106401}
m_Interactable: 0
m_TargetGraphic: {fileID: 2011106402}
m_OnClick:
m_PersistentCalls:
m_Calls:

m_MethodName: MultiImagesTrackingButtonPressed
m_MethodName: ConfigChooserButtonPressed
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}

m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &2011106401
--- !u!114 &2011106402
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}

m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!222 &2011106402
--- !u!222 &2011106403
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}

5
Assets/Scripts/UX/ARSceneSelectUI.cs


LoadScene("SampleUXScene");
}
public void ConfigChooserButtonPressed()
{
LoadScene("ConfigurationChooser");
}
public void FaceTrackingMenuButtonPressed()
{
ActiveMenu.currentMenu = MenuType.FaceTracking;

9
Assets/Scripts/UX/CheckAvailableFeatures.cs


set { m_Depth = value; }
}
[SerializeField]
Button m_ConfigChooser;
public Button configChooser
{
get => m_ConfigChooser;
set => m_ConfigChooser = value;
}
// Start is called before the first frame update
void Start()
{

m_Interaction.interactable = true;
m_SampleUX.interactable = true;
m_CheckSupport.interactable = true;
m_ConfigChooser.interactable = true;
}
if(faceDescriptors.Count > 0)

3
ProjectSettings/EditorBuildSettings.asset


path: Assets/Scenes/Check Support.unity
guid: cf67ab53e5ff241dfa61608222d82109
- enabled: 1
path: Assets/Scenes/Configurations/ConfigurationChooser.unity
guid: 3aae069bebee946a090ed6a756a1e77b
- enabled: 1
path: Assets/Scenes/EnvironmentProbes.unity
guid: d568d188cadf141e38769dbabd3fe385
- enabled: 1

8
Assets/Scenes/Configurations.meta


fileFormatVersion: 2
guid: c8b7d187eded9494aacba3b5d7216b2a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

41
Assets/Scripts/CameraSwapper.cs


using UnityEngine.XR.ARFoundation;
namespace UnityEngine.XR.ARFoundation.Samples
{
public class CameraSwapper : MonoBehaviour
{
/// <summary>
/// The camera manager for switching the camera direction.
/// </summary>
public ARCameraManager cameraManager
{
get => m_CameraManager;
set => m_CameraManager = value;
}
[SerializeField]
ARCameraManager m_CameraManager;
/// <summary>
/// On button press callback to toggle the requested camera facing direction.
/// </summary>
public void OnSwapCameraButtonPress()
{
Debug.Assert(m_CameraManager != null, "camera manager cannot be null");
CameraFacingDirection newFacingDirection;
switch (m_CameraManager.requestedFacingDirection)
{
case CameraFacingDirection.World:
newFacingDirection = CameraFacingDirection.User;
break;
case CameraFacingDirection.User:
default:
newFacingDirection = CameraFacingDirection.World;
break;
}
Debug.Log($"Switching ARCameraManager.requestedFacingDirection from {m_CameraManager.requestedFacingDirection} to {newFacingDirection}");
m_CameraManager.requestedFacingDirection = newFacingDirection;
}
}
}

11
Assets/Scripts/CameraSwapper.cs.meta


fileFormatVersion: 2
guid: 29bd2bf6583a54738a6b2063140ee4ab
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

141
Assets/Scripts/CustomConfigurationChooser.cs


using System;
using Unity.Collections;
using UnityEngine.UI;
using UnityEngine.XR.ARSubsystems;
using UnityEngine.XR.ARFoundation;
namespace UnityEngine.XR.ARFoundation.Samples
{
public class CustomConfigurationChooser : MonoBehaviour
{
/// <summary>
/// The configuration chooser mode. Values must match the UI dropdown.
/// </summary>
enum ConfigurationChooserMode
{
Default = 0,
PreferCamera = 1,
}
/// <summary>
/// The AR session on which to set the configuration chooser.
/// </summary>
public ARSession session
{
get => m_Session;
set => m_Session = value;
}
[SerializeField]
ARSession m_Session;
/// <summary>
/// The instantiated instance of the default configuration chooser.
/// </summary>
static readonly ConfigurationChooser m_DefaultConfigurationChooser = new DefaultConfigurationChooser();
/// <summary>
/// The instantiated instance of the prefer camera configuration chooser.
/// </summary>
static readonly ConfigurationChooser m_PreferCameraConfigurationChooser = new PreferCameraConfigurationChooser();
/// <summary>
/// The current configuration chooser mode.
/// </summary>
ConfigurationChooserMode m_ConfigurationChooserMode = ConfigurationChooserMode.Default;
void Start()
{
UpdateConfigurationChooser();
}
/// <summary>
/// Callback when the depth mode dropdown UI has a value change.
/// </summary>
/// <param name="dropdown">The dropdown UI that changed.</param>
public void OnDepthModeDropdownValueChanged(Dropdown dropdown)
{
// Update the display mode from the dropdown value.
m_ConfigurationChooserMode = (ConfigurationChooserMode)dropdown.value;
// Update the configuration chooser.
UpdateConfigurationChooser();
}
/// <summary>
/// Update the configuration chooser based on the current mode.
/// </summary>
void UpdateConfigurationChooser()
{
Debug.Assert(m_Session != null, "ARSession must be nonnull");
Debug.Assert(m_Session.subsystem != null, "ARSession must have a subsystem");
switch (m_ConfigurationChooserMode)
{
case ConfigurationChooserMode.PreferCamera:
m_Session.subsystem.configurationChooser = m_PreferCameraConfigurationChooser;
break;
case ConfigurationChooserMode.Default:
default:
m_Session.subsystem.configurationChooser = m_DefaultConfigurationChooser;
break;
}
}
/// <summary>
/// A custom implementation of a <see cref="ConfigurationChooser"/>.
/// </summary>
class PreferCameraConfigurationChooser : ConfigurationChooser
{
/// <summary>
/// Selects a configuration from the given <paramref name="descriptors"/> and <paramref name="requestedFeatures"/>.
/// </summary>
public override Configuration ChooseConfiguration(NativeSlice<ConfigurationDescriptor> descriptors, Feature requestedFeatures)
{
if (descriptors.Length == 0)
{
throw new ArgumentException("No configuration descriptors to choose from.", nameof(descriptors));
}
if (requestedFeatures.Intersection(Feature.AnyTrackingMode).Count() > 1)
{
throw new ArgumentException($"Zero or one tracking mode must be requested. Requested tracking modes => {requestedFeatures.Intersection(Feature.AnyTrackingMode).ToStringList()}", nameof(requestedFeatures));
}
if (requestedFeatures.Intersection(Feature.AnyCamera).Count() > 1)
{
throw new ArgumentException($"Zero or one camera mode must be requested. Requested camera modes => {requestedFeatures.Intersection(Feature.AnyCamera).ToStringList()}", nameof(requestedFeatures));
}
// Get the requested camera features out of the set of requested features.
Feature requestedCameraFeatures = requestedFeatures.Intersection(Feature.AnyCamera);
int highestFeatureWeight = -1;
int highestRank = int.MinValue;
ConfigurationDescriptor bestDescriptor = default;
foreach (var descriptor in descriptors)
{
// Initialize the feature weight with each feature being an equal weight.
int featureWeight = requestedFeatures.Intersection(descriptor.capabilities).Count();
// Increase the weight if there are matching camera features.
if (requestedCameraFeatures.Any(descriptor.capabilities))
{
featureWeight += 100;
}
// Store the descriptor with the highest feature weight.
if ((featureWeight > highestFeatureWeight) ||
(featureWeight == highestFeatureWeight && descriptor.rank > highestRank))
{
highestFeatureWeight = featureWeight;
highestRank = descriptor.rank;
bestDescriptor = descriptor;
}
}
// Return the configuration with the best matching descriptor.
return new Configuration(bestDescriptor, requestedFeatures.Intersection(bestDescriptor.capabilities));
}
}
}
}

11
Assets/Scripts/CustomConfigurationChooser.cs.meta


fileFormatVersion: 2
guid: f1cdc0d7a6c9d42ed9fe5aff9dbe95c3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

166
Assets/Scripts/DisplayARSessionInformation.cs


using System.Text;
using UnityEngine.UI;
using UnityEngine.XR.ARFoundation;
namespace UnityEngine.XR.ARFoundation.Samples
{
public class DisplayARSessionInformation : MonoBehaviour
{
/// <summary>
/// A string builder used for logging.
/// </summary>
readonly StringBuilder m_StringBuilder = new StringBuilder();
/// <summary>
/// The text UI to display the logging information.
/// </summary>
public Text infoText
{
get => m_InfoText;
set => m_InfoText = value;
}
[SerializeField]
Text m_InfoText;
/// <summary>
/// The camera manager for logging.
/// </summary>
public ARCameraManager cameraManager
{
get => m_CameraManager;
set => m_CameraManager = value;
}
[SerializeField]
ARCameraManager m_CameraManager;
/// <summary>
/// The plane manager for logging.
/// </summary>
public ARPlaneManager planeManager
{
get => m_PlaneManager;
set => m_PlaneManager = value;
}
[SerializeField]
ARPlaneManager m_PlaneManager;
/// <summary>
/// The occlusion manager for logging.
/// </summary>
public AROcclusionManager occlusionManager
{
get => m_OcclusionManager;
set => m_OcclusionManager = value;
}
[SerializeField]
AROcclusionManager m_OcclusionManager;
void Update()
{
// Clear the string builder for a new log information.
m_StringBuilder.Clear();
// Log the various manager states.
BuildCameraMangerInfo(m_StringBuilder);
BuildPlaneMangerInfo(m_StringBuilder);
BuildOcclusionMangerInfo(m_StringBuilder);
LogText(m_StringBuilder.ToString());
}
/// <summary>
/// Construct the camera manager information.
/// </summary>
void BuildCameraMangerInfo(StringBuilder stringBuilder)
{
stringBuilder.AppendLine("ARCameraManager");
if (m_CameraManager == null)
{
stringBuilder.AppendLine(" <null>");
}
else if (!m_CameraManager.enabled)
{
stringBuilder.AppendLine(" <disabled>");
}
else
{
stringBuilder.AppendLine(" Facing direction:");
stringBuilder.AppendLine($" Requested: {m_CameraManager.requestedFacingDirection}");
stringBuilder.AppendLine($" Current: {m_CameraManager.currentFacingDirection}");
stringBuilder.AppendLine(" Auto-focus:");
stringBuilder.AppendLine($" Requested: {m_CameraManager.autoFocusRequested}");
stringBuilder.AppendLine($" Current: {m_CameraManager.autoFocusEnabled}");
}
}
/// <summary>
/// Construct the plane manager information.
/// </summary>
void BuildPlaneMangerInfo(StringBuilder stringBuilder)
{
stringBuilder.AppendLine("ARPlaneManager");
if (m_PlaneManager == null)
{
stringBuilder.AppendLine(" <null>");
}
else if (!m_PlaneManager.enabled)
{
stringBuilder.AppendLine(" <disabled>");
}
else
{
stringBuilder.AppendLine(" Detection mode:");
stringBuilder.AppendLine($" Requested: {m_PlaneManager.requestedDetectionMode}");
stringBuilder.AppendLine($" Current: {m_PlaneManager.currentDetectionMode}");
}
}
/// <summary>
/// Construct the occlusion manager information.
/// </summary>
void BuildOcclusionMangerInfo(StringBuilder stringBuilder)
{
stringBuilder.AppendLine("AROcclusionManager");
if (m_OcclusionManager == null)
{
stringBuilder.AppendLine(" <null>");
}
else if (!m_OcclusionManager.enabled)
{
stringBuilder.AppendLine(" <disabled>");
}
else
{
stringBuilder.AppendLine(" Environment depth mode:");
stringBuilder.AppendLine($" Requested: {m_OcclusionManager.requestedEnvironmentDepthMode}");
stringBuilder.AppendLine($" Current: {m_OcclusionManager.currentEnvironmentDepthMode}");
stringBuilder.AppendLine(" Human stencil mode:");
stringBuilder.AppendLine($" Requested: {m_OcclusionManager.requestedHumanStencilMode}");
stringBuilder.AppendLine($" Current: {m_OcclusionManager.currentHumanStencilMode}");
stringBuilder.AppendLine(" Human depth mode:");
stringBuilder.AppendLine($" Requested: {m_OcclusionManager.requestedHumanDepthMode}");
stringBuilder.AppendLine($" Current: {m_OcclusionManager.currentHumanDepthMode}");
}
}
/// <summary>
/// Log the given text to the screen if the image info UI is set. Otherwise, log the string to debug.
/// </summary>
/// <param name="text">The text string to log.</param>
void LogText(string text)
{
if (m_InfoText != null)
{
m_InfoText.text = text;
}
else
{
Debug.Log(text);
}
}
}
}

11
Assets/Scripts/DisplayARSessionInformation.cs.meta


fileFormatVersion: 2
guid: a8793e59c6aea4d1a91bfa0038a7e8e5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

7
Assets/Scenes/Configurations/ConfigurationChooser.unity.meta


fileFormatVersion: 2
guid: 3aae069bebee946a090ed6a756a1e77b
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

63
Assets/Scenes/Configurations/ConfigurationChooserSettings.lighting


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!850595691 &4890085278179872738
LightingSettings:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: ConfigurationChooserSettings
serializedVersion: 2
m_GIWorkflowMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_RealtimeEnvironmentLighting: 1
m_BounceScale: 1
m_AlbedoBoost: 1
m_IndirectOutputScale: 1
m_UsingShadowmask: 1
m_BakeBackend: 1
m_LightmapMaxSize: 512
m_BakeResolution: 10
m_Padding: 2
m_TextureCompression: 1
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAO: 0
m_MixedBakeMode: 2
m_LightmapsBakeMode: 1
m_FilterMode: 1
m_LightmapParameters: {fileID: 0}
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_RealtimeResolution: 2
m_ForceWhiteAlbedo: 0
m_ForceUpdates: 0
m_FinalGather: 0
m_FinalGatherRayCount: 256
m_FinalGatherFiltering: 1
m_PVRCulling: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 256
m_PVREnvironmentSampleCount: 256
m_PVREnvironmentReferencePointCount: 2048
m_LightProbeSampleCountMultiplier: 4
m_PVRBounces: 2
m_PVRRussianRouletteStartBounce: 2
m_PVREnvironmentMIS: 0
m_PVRFilteringMode: 2
m_PVRDenoiserTypeDirect: 0
m_PVRDenoiserTypeIndirect: 0
m_PVRDenoiserTypeAO: 0
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1

8
Assets/Scenes/Configurations/ConfigurationChooserSettings.lighting.meta


fileFormatVersion: 2
guid: 7353b45b3628640b39b11b7732d3e52f
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

1001
Assets/Scenes/Configurations/ConfigurationChooser.unity
文件差异内容过多而无法显示
查看文件

正在加载...
取消
保存