0
我正在運行一個非常簡單的腳本來訪問攝像頭。它與我的筆記本電腦攝像頭,但它給了我,當我在我的iPhone上運行它與Unity一起運行時無法在iPhone上使用攝像頭
public class CameraController : MonoBehaviour {
public WebCamTexture mCamera = null;
public GameObject plane;
// Use this for initialization
void Start()
{
Application.RequestUserAuthorization(UserAuthorization.WebCam);
Debug.Log ("Script has been started");
plane = GameObject.FindWithTag ("Player");
mCamera = new WebCamTexture();
plane.GetComponent<Renderer>().material.mainTexture = mCamera;
mCamera.Play();
}
// Update is called once per frame
void Update() {
}
}
當我建立和運行,統一觸發了的XCode,所以它要求在那裏我還更新的info.plist白屏是否允許訪問攝像機
<key>NSCameraUsageDescription</key>
<string>$(PRODUCT_NAME) camera use</string>
我實際使用的是:( – PTN
可能是這個錯誤的版本團結?你使用的版本統一了什麼? –
其實我想通了。我必須擺脫光線。不過謝謝。 – PTN