文档

Unity Engine

Unity Engine

Play()

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

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.AudioModule
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(); }}