PhotoCapture.CreateAsync()从未执行 [英] PhotoCapture.CreateAsync() never executed

查看:62
本文介绍了PhotoCapture.CreateAsync()从未执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用HoloLens和Unity,并尝试拍照.

I'm using the HoloLens and Unity and I try to take a photo.

我在本次讨论中遇到了同样的问题 https://forums.hololens. com/discussion/897/locatable-cameraknown-issue-photocapture-createasync-doesnt-start

I have the same problem as in this discussion https://forums.hololens.com/discussion/897/locatable-camera-known-issue-photocapture-createasync-doesnt-start

此代码在Unity中的MonoBehaviour中:

This code in a MonoBehaviour in Unity :

void Start() {
  Debug.LogError("CreateAsync start");
  Debug.LogError(WebCam.Mode);
  Debug.LogError(PhotoCapture.SupportedResolutions);
  foreach (Resolution resolution in PhotoCapture.SupportedResolutions) {
    Debug.LogError(resolution);
  }
  Debug.LogError("END");
  PhotoCapture.CreateAsync(false, delegate (PhotoCapture captureObject) {
    Debug.LogError("CreateAsync done");
  }
}

打印此输出:

CreateAsync start
None
UnityEngine.Resolution[]
END

这是Package.appxmanifest中我的功能"部分:

Here is my "Capabilities" part of the Package.appxmanifest :

<Capabilities>
    <Capability Name="internetClient" />
    <uap2:Capability Name="spatialPerception" />
    <DeviceCapability Name="webcam" />
    <DeviceCapability Name="microphone" />
</Capabilities>

这是日志的模块信息"部分:

Here is the "Module information" part of the log :

Module information:
Built with Compiler Ver '190023918'
Built from '5.5/release' branch
Version is '5.5.3f1 (4d2f809fd6f3)'
Release build
Application type 'D3D11'
Used 'UWP'

OS 'Windows 10 (10.0.14393)'

您看到我的问题了吗? 其他脚本可以阻止执行吗?

Do you see my problem ? Can some other script block the execution ?

推荐答案

在hololens上:

On the hololens :

Settings/Privacy/Camera/"Let apps use my camera" => ON

有效... 我希望在这种情况下出现明确的错误消息.

It's works... I wish there was an explict error message in this case.

这篇关于PhotoCapture.CreateAsync()从未执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆