Esempio n. 1
0
	//string Informacion="3:1:35:2.7:Conserje;4:2:42.93:2.34:Marico;4:2:42.1:3.6:Marico";
	// Use this for initialization

	void Start () {
		//description= GameObject.FindGameObjectWithTag("textin").GetComponent<InputField>(); //Create a tag in InputFiel
		hacercola = false;
		position = 0;
		List<Device> listdevices = new List<Device>();
		Device a = new Device();
		a.setIdentification(2);
		a.setType(1);
		a.setLatitude(41.2712);
		a.setLongitude (1.9865);
		a.setDescription("Dinamico creado");
		listdevices.Add(a);
		Device a2 = new Device();
		a2.setIdentification(3);
		a2.setType(3);
		a2.setLatitude(41.2782);
		a2.setLongitude (1.9866);
		a2.setDescription("Dinamico creado2555555555555");
		listdevices.Add(a2);
		newObject(listdevices);

		//newObject();


	}
Esempio n. 2
0
	// Use this for initialization
	void Start () {
		listdevices = new List<Device>();	
		mydevice = new Device ();
		mydevice.setType (4);
		mydevice.setLatitude (41.278);
		mydevice.setLongitude (1.984);
		mydevice.setDescription ("Cliente Unity");
		_t1 = new Thread(Socketfunction);
		_t1.Start ();
	}
Esempio n. 3
0
	static void ProcesarData(){
		string mesage = readSocket ();
		Debug.Log ("--> Procesando Datos llegados");
		string[] data = mesage.Split (';');
		string[] data2;

		try {
			data = mesage.Split(';');
			Debug.Log ("-->Data: "+data[0]);
			Debug.Log ("-->Usuarios: "+(data.Length-2));

			for (int j = 2; j < data.Length-1; j++) {
				Debug.Log ("-->Data: "+data[j]);
				data2 = data[j].Split(':');
				Device a = new Device();

				//Debug.Log ("-->Aqui llega 1 j: "+j);
				a.setIdentification(Convert.ToInt32(data2[0]));
				a.setType(Convert.ToInt32(data2[1]));
				//Debug.Log ("-->Aqui llega 2");
				a.setLatitude(Convert.ToDouble(data2[2]));
				a.setLongitude(Convert.ToDouble(data2[3]));
				//Debug.Log ("-->Aqui llega 3");
				a.setDescription(data2[4]);
				listdevices.Add(a);
				etapa = 3;
			}
			//Hacer que los devices se pongna en el mapa  ** Con ANA **
			Debug.Log ("--> Datos procesados son: "+listdevices.Count);

			//Debug.Log ("-->Aqui llega 4");
			creator.putCola(listdevices);


		} catch (Exception e) {
			// printamos posibles excepciones
			Debug.Log ("*** Catch: "+e.ToString());
			etapa = -1;

		}
	}