The project runs properly on editor, but not when uploaded to the server.
In my project, i am fetching some detail from a table on my server and a profile pic using a link, I am getting all the data from table successfully, but profile picture is unable to load. here is the code i written.
string profileLink;
IEnumerator LoadWebData(WWW www)
{
yield return www;
if (string.IsNullOrEmpty(www.error) && !www.text.Contains("record not found"))
{
usr = JsonReader.Deserialize(www.text);
name_p1.text = usr.display_name;
name_p2.text = usr.display_name;
point_p1.text = usr.points;
point_p2.text = usr.points;
karma_p1.text = usr.level;
karma_p2.text = usr.level;
}
if (usr.profile_pic != "")
{
profileLink = "www.twitchtime.com/doforward/wp-content/uploads/2017/" + usr.profile_pic;
WWW www2 = new WWW(profileLink);
StartCoroutine(LoadProfilePic(www2));
}
}
IEnumerator LoadProfilePic(WWW www2)
{
yield return www2;
if (string.IsNullOrEmpty(www2.error))
{
profilePic.mainTexture = www2.texture;
profilePic2.mainTexture = www2.texture;
debugStr.text = profileLink;
}
debugStr.text = www2.error;
}
It shows unknown error in debugStr label.
↧