public void confirmar() { Pasodatos = GameObject.Find("PasoDatos"); datos = Pasodatos.GetComponent <scri>(); if (datos.getbossh() <= 0) { mini.correcto(); } astrofig = datos.getastrofig(); bossfig = datos.getbossfig(); if (bc.respuesta.Equals(text1.text + text2.text + text3.text)) { imagenastronormal.sprite = Resources.Load <Sprite>("Sprites/" + astrofig + " atacando"); Vector3 offset = transform.rotation * new Vector3(117f, 0, 0); Instantiate(bulletPrefab, astro.holi().position + offset, astro.holi().rotation, fondo.holi()); bc.listo = true; } else { imagenbossnormal.sprite = Resources.Load <Sprite>("Sprites/" + bossfig + " atacando"); Vector3 offset = transform.rotation * new Vector3(-175f, 0, 0); Instantiate(bulletPrefabboss, boss.holi().position + offset, boss.holi().rotation, fondo.holi()); bc.listo = true; } }
void Start() { Pasodatos = GameObject.Find("PasoDatos"); datos = Pasodatos.GetComponent <scri>(); astrofig = datos.getastrofig(); bossfig = datos.getbossfig(); try { this.astro.sprite = Resources.Load <Sprite>("Sprites/" + astrofig + " stand"); this.boss.sprite = Resources.Load <Sprite>("Sprites/" + bossfig + " stand"); } catch (System.Exception e) { e.ToString(); } if (this.transform.name == "boss") { this.health = datos.getbossh(); BossHealth.transform.localScale = new Vector2(health / maxhealth, 1); } if (this.transform.name == "astro") { this.health = datos.getastroh(); AstroHealth.transform.localScale = new Vector2(health / maxhealth, 1); } }