Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ public override ResolutionStruct[] availableResolutions
{
get
{
#if (UNITY_ANDROID || UNITY_IOS) && !UNITY_EDITOR
if (webCamDevice is WebCamDevice valueOfWebCamDevice) {
#if (UNITY_ANDROID || UNITY_IOS || UNITY_STANDALONE_OSX) && !UNITY_EDITOR
if (webCamDevice is WebCamDevice valueOfWebCamDevice && valueOfWebCamDevice.availableResolutions != null) {
return valueOfWebCamDevice.availableResolutions.Select(resolution => new ResolutionStruct(resolution)).ToArray();
}
#endif
Expand Down Expand Up @@ -146,19 +146,17 @@ private IEnumerator GetPermission()
Permission.RequestUserPermission(Permission.Camera);
yield return new WaitForSeconds(0.1f);
}
#elif UNITY_IOS
if (!Application.HasUserAuthorization(UserAuthorization.WebCam)) {
yield return Application.RequestUserAuthorization(UserAuthorization.WebCam);
}
#endif

#if UNITY_ANDROID

if (!Permission.HasUserAuthorizedPermission(Permission.Camera))
{
Debug.LogWarning("Not permitted to use Camera");
yield break;
}
#elif UNITY_IOS
#elif UNITY_IOS || UNITY_STANDALONE_OSX
if (!Application.HasUserAuthorization(UserAuthorization.WebCam)) {
yield return Application.RequestUserAuthorization(UserAuthorization.WebCam);
}

if (!Application.HasUserAuthorization(UserAuthorization.WebCam)) {
Debug.LogWarning("Not permitted to use WebCam");
yield break;
Expand Down