x


webcamtexture

I could not use play stop function of webcamtexture, following way.. I don't have any idea that where can i define webcamtexture and devices to run play and stop function of webcamtexture from ongui buttons Thank you very much..

 function Start () {

var devices : WebCamDevice[] = WebCamTexture.devices; var webcamTexture : WebCamTexture = WebCamTexture(); webcamTexture.deviceName = devices[0].name; renderer.material.mainTexture = webcamTexture; }

function Update () { }

function OnGUI() {

 GUI.Box (Rect (10,10,100,90), "Loader Menu");

 // Make the first button. If it is pressed, Application.Loadlevel (1) will be executed
 if (GUI.Button (Rect (20,40,80,20), "Camera1_Start ")) 
 {


 webcamTexture.Play();
 }
 

 // Make the second button.
 if (GUI.Button (Rect (20,70,80,20), "Camera_Stop") ) 
 
 { 
 
 webcamTexture.Stop();    
 }
 
 }
more ▼

asked Jan 05, 2012 at 07:21 AM

Student gravatar image

Student
15 18 13 21

(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x96

asked: Jan 05, 2012 at 07:21 AM

Seen: 1953 times

Last Updated: Jan 05, 2012 at 07:23 AM