浏览代码

Merge pull request #61 from unity/prep-for-arcore-depth

Prep for arcore depth
/4.1
GitHub Enterprise 4 年前
当前提交
2887de11
共有 7 个文件被更改,包括 174 次插入867 次删除
  1. 6
      Assets/Scenes/Depth/DepthImages.unity
  2. 953
      Assets/Scenes/Depth/SimpleOcclusion.unity
  3. 7
      Assets/Scripts/TestDepthImage.cs
  4. 5
      Assets/Scripts/UX/CheckAvailableFeatures.cs
  5. 8
      Packages/manifest.json
  6. 51
      Assets/Scripts/UX/CheckRuntimeDepth.cs
  7. 11
      Assets/Scripts/UX/CheckRuntimeDepth.cs.meta

6
Assets/Scenes/Depth/DepthImages.unity


m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 600, y: 120}
m_SizeDelta: {x: 900, y: 120}
m_Pivot: {x: 0, y: 0}
--- !u!114 &642201224
MonoBehaviour:

m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 60
m_FontSize: 30
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 3

m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 60
m_FontSize: 30
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 3

953
Assets/Scenes/Depth/SimpleOcclusion.unity
文件差异内容过多而无法显示
查看文件

7
Assets/Scripts/TestDepthImage.cs


void Update()
{
Debug.Assert(m_OcclusionManager != null, "no occlusion manager");
var subsystem = m_OcclusionManager.subsystem;
if (subsystem == null)
if ((m_OcclusionManager.descriptor?.supportsHumanSegmentationStencilImage == false)
&& (m_OcclusionManager.descriptor?.supportsHumanSegmentationDepthImage == false)
&& (m_OcclusionManager.descriptor?.supportsEnvironmentDepthImage == false))
m_ImageInfo.text = "Human Segmentation not supported.";
m_ImageInfo.text = "Depth functionality is not supported on this device.";
}
return;
}

5
Assets/Scripts/UX/CheckAvailableFeatures.cs


{
m_HumanSegmentation.interactable = true;
}
#if UNITY_IOS
#endif
#if UNITY_ANDROID
m_Depth.interactable = true;
#endif
}
}

8
Packages/manifest.json


"com.unity.test-framework": "1.1.14",
"com.unity.textmeshpro": "2.0.1",
"com.unity.ugui": "1.0.0",
"com.unity.xr.arcore": "4.0.3",
"com.unity.xr.arfoundation": "4.1.0-preview.1",
"com.unity.xr.arkit": "4.1.0-preview.1",
"com.unity.xr.arkit-face-tracking": "4.1.0-preview.1",
"com.unity.xr.arcore": "4.1.0-preview.2",
"com.unity.xr.arfoundation": "4.1.0-preview.2",
"com.unity.xr.arkit": "4.1.0-preview.2",
"com.unity.xr.arkit-face-tracking": "4.1.0-preview.2",
"com.unity.xr.interaction.toolkit": "0.9.4-preview",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",

51
Assets/Scripts/UX/CheckRuntimeDepth.cs


using System;
using System.Text;
using Unity.Collections.LowLevel.Unsafe;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.XR.ARFoundation;
using UnityEngine.XR.ARSubsystems;
namespace UnityEngine.XR.ARFoundation.Samples
{
/// <summary>
/// This component tests for depth functionality and enables/disables
/// a text message on the screen reporting that depth is not suppoted.
/// </summary>
public class CheckRuntimeDepth : MonoBehaviour
{
[SerializeField]
[Tooltip("The AROcclusionManager which will manage depth functionality.")]
AROcclusionManager m_OcclusionManager;
/// <summary>
/// Get or set the <c>AROcclusionManager</c>.
/// </summary>
public AROcclusionManager occlusionManager
{
get { return m_OcclusionManager; }
set { m_OcclusionManager = value; }
}
[SerializeField]
Text m_DepthAvailabilityInfo;
/// <summary>
/// The UI Text used to display information about the availability of depth functionality.
/// </summary>
public Text depthAvailabilityInfo
{
get { return m_DepthAvailabilityInfo; }
set { m_DepthAvailabilityInfo = value; }
}
void Update()
{
Debug.Assert(m_OcclusionManager != null, "no occlusion manager");
Debug.Assert(m_DepthAvailabilityInfo != null, "no text box");
m_DepthAvailabilityInfo.enabled = ((m_OcclusionManager.descriptor?.supportsHumanSegmentationStencilImage == false)
&& (m_OcclusionManager.descriptor?.supportsHumanSegmentationDepthImage == false)
&& (m_OcclusionManager.descriptor?.supportsEnvironmentDepthImage == false));
}
}
}

11
Assets/Scripts/UX/CheckRuntimeDepth.cs.meta


fileFormatVersion: 2
guid: 3604c16c635de4e029b7ec13aed43bee
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存