Starts the camera.
// Starts the default camera and assigns the texture to the current renderer function Start () { var webcamTexture : WebCamTexture = WebCamTexture(); renderer.material.mainTexture = webcamTexture; webcamTexture.Play(); }
using UnityEngine; using System.Collections; public class Example : MonoBehaviour { void Start() { WebCamTexture webcamTexture = new WebCamTexture(); renderer.material.mainTexture = webcamTexture; webcamTexture.Play(); } }
import UnityEngine import System.Collections public class Example(MonoBehaviour): def Start() as void: webcamTexture as WebCamTexture = WebCamTexture() renderer.material.mainTexture = webcamTexture webcamTexture.Play()