浏览代码

Fixing a bug and behavior when human segmentation or env depth functionality is not available.

/4.1
Todd Stinson 4 年前
当前提交
97521bce
共有 1 个文件被更改,包括 24 次插入3 次删除
  1. 27
      Assets/Scripts/TestDepthImage.cs

27
Assets/Scripts/TestDepthImage.cs


const string k_MaxDistanceName = "_MaxDistance";
/// <summary>
/// The default texture aspect ratio.
/// </summary>
const float k_DefaultTextureAspectRadio = 1.0f;
/// <summary>
/// ID of the texture rotation property in the shader.
/// </summary>
static readonly int k_TextureRotationId = Shader.PropertyToID(k_TextureRotationName);

/// <summary>
/// The current texture aspect ratio remembered so that we can resize the raw image layout when it changes.
/// </summary>
float m_TextureAspectRatio = 1.0f;
float m_TextureAspectRatio = k_DefaultTextureAspectRadio;
/// <summary>
/// The mode indicating which texture to display.

{
case DisplayMode.HumanDepth:
case DisplayMode.HumanStencil:
if ((m_OcclusionManager.descriptor?.supportsHumanSegmentationDepthImage == false)
&& (m_OcclusionManager.descriptor?.supportsEnvironmentDepthImage == false))
if ((m_OcclusionManager.descriptor?.supportsHumanSegmentationStencilImage == false)
&& (m_OcclusionManager.descriptor?.supportsHumanSegmentationDepthImage == false))
m_RawImage.texture = null;
if (!Mathf.Approximately(m_TextureAspectRatio, k_DefaultTextureAspectRadio))
{
m_TextureAspectRatio = k_DefaultTextureAspectRadio;
UpdateRawImage();
}
return;
}
break;

{
m_ImageInfo.text = "Environment depth is not supported on this device.";
}
m_RawImage.texture = null;
if (!Mathf.Approximately(m_TextureAspectRatio, k_DefaultTextureAspectRadio))
{
m_TextureAspectRatio = k_DefaultTextureAspectRadio;
UpdateRawImage();
}
return;
}
break;

正在加载...
取消
保存