|
Hello guys. I want to have a web camera stream in my project. I found the code and it is working perfectly. I would like to reproduce that code in C# but i lack the skills. Can anyone help out ???
Thanks.
(comments are locked)
|
|
Something like this should do it. (name your script "WebCam" to match the class).
(Edit - now tested, and bugs fixed!) Nice code. 2 small errors. 1. You declare the variable www twice, once in the parentheses and once inside the method so you should take out the one in parentheses. 2. You need to cast mainTexture into Texture2D. Besides that perfect :)
Apr 13 '10 at 09:44 PM
Peter G
Thanks for the pointers - fixed in the example now. Also I changed to to yield directly using the www rather than yielding null while polling www.isDone. Much neater.
Apr 13 '10 at 10:09 PM
duck ♦♦
Thank you. Worked like a charm :)
Apr 14 '10 at 04:16 PM
gotmilk
Why is while(true) never breaked?
Jan 11 '11 at 02:15 AM
brandonc
because the code repeated loads the next camera frame. There's a "yield" inside the loop, so the code doesn't block the rest of your app (it releases control to the rest of your program while waiting for the next WWW to complete).
Jan 11 '11 at 12:37 PM
duck ♦♦
(comments are locked)
|
