Can I take a photo in Unity using the device's camera?

前端 未结 7 801
春和景丽
春和景丽 2020-12-06 00:18

I\'m entirely unfamiliar with Unity3D\'s more complex feature set and am curious if it has the capability to take a picture and then manipulate it. Specifically my desire is

7条回答
  •  天涯浪人
    2020-12-06 00:37

    Bart's answer has a required modification. I used his code and the pic I was getting was black. Required modification is that we have to convert TakePhoto to a coroutine and add

    yield return new WaitForEndOfFrame(); 
    

    at the start of Coroutine. (Courtsey @fafase) For more details see http://docs.unity3d.com/ScriptReference/WaitForEndOfFrame.html

    You can also refer to

    Take photo using webcam is giving black output[Unity3D]

提交回复
热议问题