浏览代码

4.2.0-pre.12

/4.2
Tim Mowrer 3 年前
当前提交
5acffaed
共有 3 个文件被更改,包括 12 次插入11 次删除
  1. 9
      Assets/Scripts/CameraConfigController.cs
  2. 6
      Assets/Scripts/CpuImageSample.cs
  3. 8
      Packages/manifest.json

9
Assets/Scripts/CameraConfigController.cs


using UnityEngine;
using UnityEngine.UI;
using UnityEngine.XR.ARFoundation;
using UnityEngine.XR.ARSubsystems;
namespace UnityEngine.XR.ARFoundation.Samples
{

/// </summary>
public ARCameraManager cameraManager
{
get { return m_CameraManager; }
set { m_CameraManager = value; }
get => m_CameraManager;
set => m_CameraManager = value;
}
/// <summary>

// 1. Use a foreach to iterate over all the available configurations
foreach (var config in configurations)
{
m_ConfigurationNames.Add($"{config.width}x{config.height}{(config.framerate.HasValue ? $" at {config.framerate.Value} Hz" : "")}");
m_ConfigurationNames.Add($"{config.width}x{config.height}{(config.framerate.HasValue ? $" at {config.framerate.Value} Hz" : "")}{(config.depthSensorSupported == Supported.Supported ? " depth sensor" : "")}");
}
m_Dropdown.AddOptions(m_ConfigurationNames);

PopulateDropdown();
}
}
}
}

6
Assets/Scripts/CpuImageSample.cs


// Attempt to get the latest human stencil image. If this method succeeds,
// it acquires a native resource that must be disposed (see below).
if (occlusionManager && occlusionManager.TryAcquireHumanStencilCpuImage(out XRCpuImage image))
if (occlusionManager && occlusionManager.TryAcquireHumanStencilCpuImage(out var image))
{
using (image)
{

// Attempt to get the latest environment depth image. If this method succeeds,
// it acquires a native resource that must be disposed (see below).
if (occlusionManager && occlusionManager.TryAcquireEnvironmentDepthCpuImage(out XRCpuImage image))
if (occlusionManager && occlusionManager.TryAcquireEnvironmentDepthCpuImage(out var image))
{
using (image)
{

// Attempt to get the latest environment depth image. If this method succeeds,
// it acquires a native resource that must be disposed (see below).
if (occlusionManager && occlusionManager.TryAcquireEnvironmentDepthConfidenceCpuImage(out XRCpuImage image))
if (occlusionManager && occlusionManager.TryAcquireEnvironmentDepthConfidenceCpuImage(out var image))
{
using (image)
{

8
Packages/manifest.json


"com.unity.ide.vscode": "1.2.3",
"com.unity.inputsystem": "1.0.2",
"com.unity.ugui": "1.0.0",
"com.unity.xr.arcore": "4.2.0-pre.9",
"com.unity.xr.arfoundation": "4.2.0-pre.9",
"com.unity.xr.arkit": "4.2.0-pre.9",
"com.unity.xr.arkit-face-tracking": "4.2.0-pre.9",
"com.unity.xr.arcore": "4.2.0-pre.12",
"com.unity.xr.arfoundation": "4.2.0-pre.12",
"com.unity.xr.arkit": "4.2.0-pre.12",
"com.unity.xr.arkit-face-tracking": "4.2.0-pre.12",
"com.unity.xr.interaction.toolkit": "1.0.0-pre.3",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",

正在加载...
取消
保存