浏览代码

Merge pull request #60 from unity/enable-arcore-depth-in-menu

Enable arcore depth in menu
/4.1
GitHub Enterprise 5 年前
当前提交
806ba6dc
共有 5 个文件被更改,包括 167 次插入860 次删除
  1. 953
      Assets/Scenes/Depth/SimpleOcclusion.unity
  2. 7
      Assets/Scripts/TestDepthImage.cs
  3. 5
      Assets/Scripts/UX/CheckAvailableFeatures.cs
  4. 51
      Assets/Scripts/UX/CheckRuntimeDepth.cs
  5. 11
      Assets/Scripts/UX/CheckRuntimeDepth.cs.meta

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
}
}

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:
正在加载...
取消
保存