Quantcast
Channel: Questions in topic: "webcam"
Viewing all articles
Browse latest Browse all 256

iOS build crashes when trying to access WebCamTexture.videoRotationAngle

$
0
0
using UnityEngine; using System.Collections; public class SelfieScreen : MonoBehaviour { private CanvasRenderer m_renderer; private WebCamTexture m_selfie; private WebCamDevice [] m_webCamDevices; private Quaternion m_baseRotation; private Material m_material; void Start() { m_baseRotation = transform.rotation; m_renderer = GetComponent(); m_material = m_renderer.GetMaterial(); m_webCamDevices = WebCamTexture.devices; m_selfie = new WebCamTexture(m_webCamDevices[m_webCamDevices.Length - 1].name, Screen.width, Screen.height); m_renderer.SetMaterial(m_renderer.GetMaterial(), m_selfie); Logger.Log(m_selfie.videoRotationAngle); Logger.Log(m_selfie.videoVerticallyMirrored); m_selfie.Play(); } void Update() { m_renderer.SetMaterial(m_renderer.GetMaterial(), m_selfie); } } This code works well when i build it on unity editor. But when i build this to iphone it crashes on launch. If I comment out the line that tries to print the videoRotationAngle then then build works on iphone. Anyone has experienced this?

Viewing all articles
Browse latest Browse all 256

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>