public static bool IsQCAREnabled() { if (!IsPlayMode()) { return(true); } if (sWebCamUsed == WebCamUsed.UNKNOWN) { WebCamAbstractBehaviour behaviour = (WebCamAbstractBehaviour)UnityEngine.Object.FindObjectOfType(typeof(WebCamAbstractBehaviour)); sWebCamUsed = behaviour.IsWebCamUsed() ? WebCamUsed.TRUE : WebCamUsed.FALSE; } return(sWebCamUsed == WebCamUsed.TRUE); }
/// <summary> /// returns true if we have access to QCAR (on a mobile device OR in the emulator in Unity Pro with a webcam connected) /// </summary> public static bool IsQCAREnabled() { #if UNITY_EDITOR if (sWebCamUsed == WebCamUsed.UNKNOWN) { // query the webcam if it should be used WebCamBehaviour webcam = (WebCamBehaviour)Object.FindObjectOfType(typeof(WebCamBehaviour)); sWebCamUsed = webcam.IsWebCamUsed() ? WebCamUsed.TRUE : WebCamUsed.FALSE; } return(sWebCamUsed == WebCamUsed.TRUE); #else return(true); #endif }
/// <summary> /// returns true if we have access to QCAR (on a mobile device OR in the emulator in Unity Pro with a webcam connected) /// </summary> public static bool IsQCAREnabled() { #if UNITY_EDITOR if (sWebCamUsed == WebCamUsed.UNKNOWN) { // query the webcam if it should be used WebCamBehaviour webcam = (WebCamBehaviour)Object.FindObjectOfType(typeof(WebCamBehaviour)); sWebCamUsed = webcam.IsWebCamUsed() ? WebCamUsed.TRUE : WebCamUsed.FALSE; } return sWebCamUsed == WebCamUsed.TRUE; #else return true; #endif }