Объявление
public void Play();Описание
Запускает камеру.
Вызовите Application.RequestUserAuthorization перед созданием Текстура веб-камеры.
// Запускает камеру по умолчанию и назначает текстуру текущему рендереру
using UnityEngine;
using System.Collections;
public class ExampleClass : MonoBehaviour
{
void Start()
{
WebCamTexture webcamTexture = new WebCamTexture();
Renderer renderer = GetComponent<Renderer>();
renderer.material.mainTexture = webcamTexture;
webcamTexture.Play();
}
}