Version: 2017.1

Application.RequestUserAuthorization

Cambiar al Manual
public static AsyncOperation RequestUserAuthorization (UserAuthorization mode);

Descripción

Solicita autorización para usar la webcam o el micrófono en el Web Player.

For security reasons we require you to have the user explicitly allow these features in the web player. To do so, you need to call Application.RequestUserAuthorization, which shows a dialog box to the user, and wait for operation to complete before being able to use these features. Use Application.HasUserAuthorization to query the result of the operation.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { IEnumerator Start() { yield return Application.RequestUserAuthorization(UserAuthorization.WebCam | UserAuthorization.Microphone); if (Application.HasUserAuthorization(UserAuthorization.WebCam | UserAuthorization.Microphone)) { } else { } } }

Note: The web player is not supported from 5.4.0 onwards.