浏览代码

Merge pull request #62 from unity/update-body-tracking-menu

Renaming the human segmentation items to body tracking
/4.1
GitHub Enterprise 4 年前
当前提交
9295678e
共有 5 个文件被更改,包括 45 次插入247 次删除
  1. 229
      Assets/Scenes/ARFoundationMenu/Menu.unity
  2. 2
      Assets/Scenes/HumanTracking/HumanBodyTracking3D.unity
  3. 29
      Assets/Scripts/UX/ARSceneSelectUI.cs
  4. 2
      Assets/Scripts/UX/ActiveMenu.cs
  5. 30
      Assets/Scripts/UX/CheckAvailableFeatures.cs

229
Assets/Scenes/ARFoundationMenu/Menu.unity


m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 774532498}
m_MethodName: HumanSegmentation3DButtonPressed
m_MethodName: BodyTracking3DButtonPressed
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}

m_EditorClassIdentifier:
m_AllMenu: {fileID: 1569808630}
m_FaceTrackingMenu: {fileID: 881193863}
m_HumanSegmentationMenu: {fileID: 1468820548}
m_BodyTrackingMenu: {fileID: 1468820548}
m_PlaneDetectionMenu: {fileID: 881169046}
m_MeshingMenu: {fileID: 2008080040}
m_DepthMenu: {fileID: 1017732099}

m_FaceTracking: {fileID: 1116959538}
m_FaceBlendShapes: {fileID: 507951178}
m_FaceRegions: {fileID: 876148839}
m_HumanSegmentation: {fileID: 2111581279}
m_BodyTracking: {fileID: 2111581279}
m_LightEstimation: {fileID: 11739801}
m_PlaneDetection: {fileID: 1172329691}
m_PlaneClassification: {fileID: 988159692}

m_Name:
m_EditorClassIdentifier:
m_Tooltip: {fileID: 2094799242}
--- !u!1 &855858568
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 855858569}
- component: {fileID: 855858571}
- component: {fileID: 855858570}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &855858569
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 855858568}
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: 1441317956}
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 &855858570
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 855858568}
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_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: Images
--- !u!222 &855858571
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 855858568}
m_CullTransparentMesh: 0
--- !u!1 &876148837
GameObject:
m_ObjectHideFlags: 0

m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: Segmentation
m_Text: Body Tracking
--- !u!222 &880896171
CanvasRenderer:
m_ObjectHideFlags: 0

m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 774532498}
m_MethodName: HumanSegmentation2DButtonPressed
m_MethodName: BodyTracking2DButtonPressed
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}

m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1441317955
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1441317956}
- component: {fileID: 1441317959}
- component: {fileID: 1441317958}
- component: {fileID: 1441317957}
m_Layer: 5
m_Name: HumanSegmentationImages
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1441317956
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1441317955}
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: 855858569}
m_Father: {fileID: 1468820549}
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}
m_AnchoredPosition: {x: 0, y: -125}
m_SizeDelta: {x: 160, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1441317957
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1441317955}
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: 1441317958}
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 774532498}
m_MethodName: HumanSegmentationImagesButtonPressed
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 &1441317958
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1441317955}
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_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 &1441317959
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1441317955}
m_CullTransparentMesh: 0
--- !u!1 &1459382204
GameObject:
m_ObjectHideFlags: 0

m_Component:
- component: {fileID: 1468820549}
m_Layer: 5
m_Name: HumanSegmentationScenes
m_Name: BodyTrackingScenes
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0

- {fileID: 1909022301}
- {fileID: 1356389282}
- {fileID: 368937169}
- {fileID: 1441317956}
m_Father: {fileID: 1413559114}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

m_TargetGraphic: {fileID: 1130901186}
m_HandleRect: {fileID: 1130901185}
m_Direction: 2
m_Value: 0.99999946
m_Size: 0.80272716
m_Value: 1
m_Size: 0.8027273
m_NumberOfSteps: 0
m_OnValueChanged:
m_PersistentCalls:

- component: {fileID: 2111581279}
- component: {fileID: 2111581282}
m_Layer: 5
m_Name: HumanSegmentation
m_Name: BodyTracking
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0

m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 774532498}
m_MethodName: HumanSegmentationMenuButtonPressed
m_MethodName: BodyTrackingMenuButtonPressed
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}

2
Assets/Scenes/HumanTracking/HumanBodyTracking3D.unity


m_EditorClassIdentifier:
m_Pose2D: 0
m_Pose3D: 1
m_Pose3DScaleEstimation: 1
m_Pose3DScaleEstimation: 0
m_HumanBodyPrefab: {fileID: 0}
--- !u!1 &1427795752
GameObject:

29
Assets/Scripts/UX/ARSceneSelectUI.cs


}
[SerializeField]
GameObject m_HumanSegmentationMenu;
public GameObject humanSegmentationMenu
GameObject m_BodyTrackingMenu;
public GameObject bodyTrackingMenu
get { return m_HumanSegmentationMenu; }
set { m_HumanSegmentationMenu = value; }
get { return m_BodyTrackingMenu; }
set { m_BodyTrackingMenu = value; }
}
[SerializeField]

m_PlaneDetectionMenu.SetActive(true);
m_AllMenu.SetActive(false);
}
else if(ActiveMenu.currentMenu == MenuType.HumanSegmentation)
else if(ActiveMenu.currentMenu == MenuType.BodyTracking)
m_HumanSegmentationMenu.SetActive(true);
m_BodyTrackingMenu.SetActive(true);
m_AllMenu.SetActive(false);
}
else if(ActiveMenu.currentMenu == MenuType.Meshing)

LoadScene("WorldCameraWithUserFacingFaceTracking");
}
public void HumanSegmentationMenuButtonPressed()
public void BodyTrackingMenuButtonPressed()
ActiveMenu.currentMenu = MenuType.HumanSegmentation;
m_HumanSegmentationMenu.SetActive(true);
ActiveMenu.currentMenu = MenuType.BodyTracking;
m_BodyTrackingMenu.SetActive(true);
public void HumanSegmentation2DButtonPressed()
public void BodyTracking2DButtonPressed()
public void HumanSegmentation3DButtonPressed()
public void BodyTracking3DButtonPressed()
}
public void HumanSegmentationImagesButtonPressed()
{
LoadScene("HumanSegmentationImages");
}
public void LightEstimationButtonPressed()

ActiveMenu.currentMenu = MenuType.Main;
m_FaceTrackingMenu.SetActive(false);
m_PlaneDetectionMenu.SetActive(false);
m_HumanSegmentationMenu.SetActive(false);
m_BodyTrackingMenu.SetActive(false);
m_MeshingMenu.SetActive(false);
m_DepthMenu.SetActive(false);
m_AllMenu.SetActive(true);

2
Assets/Scripts/UX/ActiveMenu.cs


Main,
FaceTracking,
PlaneDetection,
HumanSegmentation,
BodyTracking,
Meshing,
Depth
}

30
Assets/Scripts/UX/CheckAvailableFeatures.cs


}
[SerializeField]
Button m_HumanSegmentation;
public Button humanSegmentation
Button m_BodyTracking;
public Button bodyTracking
get { return m_HumanSegmentation; }
set { m_HumanSegmentation = value; }
get { return m_BodyTracking; }
set { m_BodyTracking = value; }
}
[SerializeField]

var sessionDescriptors = new List<XRSessionSubsystemDescriptor>();
SubsystemManager.GetSubsystemDescriptors<XRSessionSubsystemDescriptor>(sessionDescriptors);
var bodyTrackingDescriptors = new List<XRHumanBodySubsystemDescriptor>();
SubsystemManager.GetSubsystemDescriptors<XRHumanBodySubsystemDescriptor>(bodyTrackingDescriptors);
if(planeDescriptors.Count > 0 && rayCastDescriptors.Count > 0)
{
m_SimpleAR.interactable = true;

{
foreach(var occlusionDescriptor in occlusionDescriptors)
{
if(occlusionDescriptor.supportsHumanSegmentationDepthImage && occlusionDescriptor.supportsHumanSegmentationStencilImage)
{
m_HumanSegmentation.interactable = true;
}
if(occlusionDescriptor.supportsEnvironmentDepthImage)
if(occlusionDescriptor.supportsEnvironmentDepthImage
|| occlusionDescriptor.supportsHumanSegmentationDepthImage
|| occlusionDescriptor.supportsHumanSegmentationStencilImage)
{
m_Depth.interactable = true;
}

#endif
}
}
if(bodyTrackingDescriptors.Count > 0)
{
foreach(var bodyTrackingDescriptor in bodyTrackingDescriptors)
{
if(bodyTrackingDescriptor.supportsHumanBody2D || bodyTrackingDescriptor.supportsHumanBody3D)
{
m_BodyTracking.interactable = true;
}
}
}

正在加载...
取消
保存