I have some method to comunity with server, But when i use www in a function in class -> it doesn’t run , to check i use www like with code i use in class –> it run.. I don’t know what’s happening, please help me!
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Create a new class that does inherit MonoBehaviour, then call that.
Example of Javascript(unity) way
// Get the latest webcam shot from outside “Friday’s” in Times Square
var url = “http://images.earthcam.com/ec_metros/ourcams/fridays.jpg”;
function Start () {
// Start a download of the given URL
var www : WWW = new WWW (url);
[EDIT] Example of C# way
Call like so
[Edit]
Basicly Javascript files in Unity automatically inherit from MonoBehavior.
If you are absolutly certain you cant/wont just create a class that inherits monobehaviour (Example #1) to do the work for you, then your asking how to do a normal XMLHttpRequest to a url.
Javascript Example here:
The really complicated part of this is you will need to parse your http response into unity objects…