private void EquipoOrden() { Refresh(); EquipoControl ec = grabbed.GetComponent <EquipoControl>(); texto.GetComponent <Text>().text = "Nombre: " + ec.equip.codigo; textoSac.Add(GameObject.Instantiate(texto, this.gameObject.transform)); textoSac.Add(GameObject.Instantiate(texto, this.gameObject.transform)); textoSac.Add(GameObject.Instantiate(texto, this.gameObject.transform)); textoSac[0].GetComponent <Text>().text = "Tipo: " + ec.GetTipoEsp(); textoSac[1].GetComponent <Text>().text = "CFM real: " + ec.CFMreal(); if (ec.equip.calculo) { textoSac[2].GetComponent <Text>().text = "Equipo de ventilación"; } else { textoSac[2].GetComponent <Text>().text = "Equipo de aire acondicionado"; textoSac[2].GetComponent <RectTransform>().sizeDelta = new Vector2(200, 20); textoSac[2].GetComponent <RectTransform>().SetInsetAndSizeFromParentEdge(RectTransform.Edge.Left, 10, 200); } ReOrderElements(); }
/// <summary> /// Obtiene los valores del equipo y los pone en el canvas /// </summary> public void Exploit() { if (target == null) { return; } codigo.text = target.equip.codigo; if (target.equip.calculo) { calculo.value = 1; } else { calculo.value = 0; } tipo.value = target.equip.tipo; velocidadIny.text = "" + target.equip.velocidadIny; velocidadExt.text = "" + target.equip.velocidadExt; porcentajeIny.text = "" + target.equip.porcentajeIny; porcentajeExt.text = "" + target.equip.porcentajeExt; if (target.equip.potencia < 0) { potencia.text = target.getAutoPotencia() + ""; } else { potencia.text = "" + target.equip.potencia; } espPotencia.isOn = target.equip.potencia < 0; if (target.equip.sistema) { sistema.value = 1; } else { sistema.value = 0; } voltaje.text = target.equip.voltaje + ""; Hz.text = target.equip.Hz + ""; caudal.text = target.equip.caudal + ""; //caution: el tipo de sistema es algo complicado, por el hecho que lo antiguo viene puesto.... y algo mas tipoEsp.value = tipoEsp.options.FindIndex(option => option.text == target.GetTipoEsp()); enfEntrada1.text = target.equip.enfEntrada1 + ""; enfEntrada2.text = target.equip.enfEntrada2 + ""; enfSalida1.text = target.equip.enfSalida1 + ""; enfSalida2.text = target.equip.enfSalida2 + ""; CSensible.text = target.equip.CSensible + ""; CLatente.text = target.equip.CLatente + ""; CTotal.text = (target.equip.CSensible + target.equip.CLatente) + ""; ESensible.text = target.equip.ESensible + ""; ELatente.text = target.equip.ELatente + ""; ETotal.text = (target.equip.ESensible + target.equip.ELatente) + ""; ToggleEnfriamiento(ET); ToggleCalentamiento(CT); Debug.Log("Exploited"); }