文档

Unity Engine

Unity Engine

Play()

Starts the camera.
阅读时间1 分钟最后更新于 1 天前

Definition

public void Play()

Remarks

Call Application.RequestUserAuthorization before creating a WebCamTexture.

Examples

// Starts the default camera and assigns the texture to the current rendererusing UnityEngine;using System.Collections;public class ExampleClass : MonoBehaviour{ void Start() { WebCamTexture webcamTexture = new WebCamTexture(); Renderer renderer = GetComponent<Renderer>(); renderer.material.mainTexture = webcamTexture; webcamTexture.Play(); }}