hi, I've problems downloading text files (with .htm extension) from url inside webplayer. All works on standalone version I've implemented WWWLoader script:
`using System;
using System.Collections;
using UnityEngine;
public class WWWLoader:MonoBehaviour
{
private static WWWLoader s_Instance = null;
public static WWWLoader instance
{
get
{
if (s_Instance == null)
{
GameObject obj = new GameObject("_WWWLoader");
s_Instance = (WWWLoader)obj.AddComponent(typeof(WWWLoader));
}
return s_Instance;
}
}
public IEnumerator WaitForLoad(WWW www)
{
yield return www;
if (www.error != null)
{
Debug.Log("WWWLoader Error - \"" + www.url + "\" : "+ www.error);
} else {
Debug.Log("WWW completed!");
}
}
public static WWW Load(string url)
{
WWW www = new WWW(url);
instance.StartCoroutine(WWWLoader.instance.WaitForLoad(www));
return www;
}
}`
i use this class in my script:
private string[] idCar=new string[]{"496","1800","1346"};
...
void Import (string raceId) {
int i=0;
while(i<idCar.Length){
string url = "http://www.mediterrando.net/pauroleague/unity/webplayer/demo/viewscud/"+idCar*+".htm";*
_//string url = "http://localhost/pauroleague/unity/webplayer/demo/viewscud/"+idCar*+".htm";*_
_*Debug.Log (url);*_
_*//WWW www = new WWW (url);*_
_*WWW www =WWWLoader.Load(url);*_
_while(!www.isDone) Debug.Log ("Loading "+idCar*+":"+www.error+":"+www.progress);*_
_*//yield return www;*_
_*ImportScuderia importer = new ImportScuderia (www.text);*_
_*Scuderia team = importer.getTeam ();*_
_*Debug.Log ("TeamName=" + team.TeamName);*_
_*Debug.Log ("TeamCar=" + team.TeamCar);*_
_*//Circuit circuit=new Circuit();*_
_cars*=new Car(team);
*_
_*```*_
_cars*.getCar().name=(team.TeamName);*_
_*i++;*_
_*}*_
_*circuit = new Circuit("11");*_
_*}*_
_*
*_
_*```*_
_*but WWW won't download resources (standalone works)
*_ _*projects is at
*_ _**_ _*any help would be appreciated*_ _*bye
*_
It's not c++ it's C#
– Berny