Exemplo n.º 1
0
    //...................GeekerX
    // Use this for initialization
    void Start()
    {
        //objetoPadre = GameObject.Find ("Canvas");
        objetoCarrete = objetoPadre.GetComponent<CrearCarrete>();
        mostrarDatos = objetoPadre.GetComponent<MostrarDatosGPS>();
        vr = new Vector3 (1, 1, 1);
        //tmp = new GameObject();
        //tmp.name = "tmp";

        //		//............................................GeekerX
        //		DirectoryInfo dir = new DirectoryInfo(Application.persistentDataPath+"/Resources/3d/");
        //		FileInfo[] info = dir.GetFiles("*.fbx");
        //		int z = 0;
        //		foreach (FileInfo f in info) {
        //			//f.Name.TrimEnd(".fbx");
        //			z++;
        //		}
        //		char[] charsToTrim = {'x','b','f','.'};
        //		nombreObjetos = new string[z];
        //		url = new string[z];
        //		z = 0;
        //		foreach (FileInfo f in info) {
        //			//f.Name.TrimEnd(".fbx");
        //			nombreObjetos[z] = f.Name.TrimEnd(charsToTrim);
        //			Debug.Log(nombreObjetos[z]);
        //			z++;
        //		}
        //		Debug.Log ("------------------------------------" + z);
        //		for(int i = 0; i < z; i++) {
        //			url[i] = "file://"+Application.persistentDataPath+"/Resources/3d/" + nombreObjetos[i] + ".fbx";
        //			Debug.Log(url[i]);
        //			www = new WWW(url[i]);
        //			if ((int)www.texture.width != 8)
        //			{
        //				if (www.texture.width!=8)
        //					yield return www;
        //				else
        //					break;
        //			}
        //		}
        //
        //		Debug.Log ("Se generar las url");
        //		Objetos3D = new GameObject[z];
        //		z = 0;
        //		while (z < Objetos3D.Length)
        //		{
        //			www = new WWW(url[z]);
        //			yield return www;
        //			if (www.error != null)
        //				throw new Exception(www.error);
        //			AssetBundle assetBundle = www.assetBundle;
        //			Debug.Log(assetBundle.name);
        //			Objetos3D [z] = assetBundle.LoadAsset(nombreObjetos[z],typeof (T)) as GameObject;
        //			//Objetos3D [z] = (GameObject)www;
        //			z++;
        //		}
        //		//......................................................GeekerX
    }
Exemplo n.º 2
0
 void Start()
 {
     objetoPadre = GameObject.Find ("Canvas");
     mostrarDatos = objetoPadre.GetComponent<MostrarDatosGPS>();
 }