public void ExplodeSkill() { SC_Spawns Spawn = GameObject.Find("SpawnManager").GetComponent <SC_Spawns>(); Spawn.Incoming += 0.2f; actLPA = new Vector2[] { new Vector2(transform.position.x, transform.position.y + 1.5f), new Vector2(transform.position.x - 0.47f, transform.position.y + 1.5f), new Vector2(transform.position.x + 0.47f, transform.position.y + 1.5f), new Vector2(transform.position.x - 0.82f, transform.position.y + 1.2f), new Vector2(transform.position.x + 0.82f, transform.position.y + 1.2f) }; for (int i = 0; i < 5; i++) { GameObject actPA = Instantiate(objPA[i], actLPA[i], transform.rotation); actPA.GetComponent <Rigidbody2D>().velocity = new Vector2(0, 20); } for (int i = 0; i < gbjParticle.Length; i++) { gbjParticle[i].GetComponent <ParticleSystem>().Play(); } this.GetComponent <SC_AudioManager>().PlayAudio(0, 0.5f); }
// Método de detección de colisiones. private void OnCollisionEnter2D(Collision2D coll) { if (coll.gameObject.tag == "Power Up") { SC_Spawns Spawn = GameObject.Find("SpawnManager").GetComponent <SC_Spawns>(); Spawn.BossActive = true; Spawn.Oleada++; Spawn.Progress = 0; Spawn.ProgressBar.gameObject.SetActive(true); PowerUp(); Destroy(coll.gameObject); } }