void OnTriggerEnter2D(Collider2D c) { if (c.tag == "Boost") { // GetComponent<Rigidbody2D> ().AddForce (new Vector2 (500, 500)); //transform.Rotate(Vector3.up * Time.deltaTime, Space.World); AddPoints(1); soul.Explosion(); Destroy(gameObject); } if (c.tag == "Rainbow") { GetComponent <AudioSource>().Play(); soul.Burn(spriteRend); GetComponent <Rigidbody2D>().AddForce(new Vector2(0, 500)); } if (c.tag == "MaxBoost") { AddPoints(1); soul.Explosion(); Destroy(gameObject); } if (c.tag == "KillZone") { Destroy(gameObject); } }
IEnumerator SpectrumPhases() { if (isEvent) { canroutine = false; canmove = true; yield return(new WaitForSeconds(10f)); canmove = false; yield return(new WaitForSeconds(3f)); soul.Explosion(); Destroy(gameObject); } else { canroutine = false; canmove = true; yield return(new WaitForSeconds(10f)); canmove = false; yield return(new WaitForSeconds(3f)); canmove = true; canroutine = true; StopCoroutine("spectrumphases"); } }
void OnTriggerEnter2D(Collider2D c) { AtualizaRank(); if (c.tag == "KillZone") { soul.Explosion(); Destroy(gameObject); } if (c.tag == "DarkRainbow" && !spectroChecker) { if (this.gameObject.tag == "Player" || this.gameObject.tag == "Boost" || this.gameObject.tag == "MaxBoost") { SpectroEvent(); } } if (boostActive == false && this.gameObject.tag == "Player") { if (c.tag == "Enemy") { soul.Explosion(); Destroy(gameObject); } else if (c.tag == "EnemyFall") { soul.Explosion(); Destroy(gameObject); } } if (c.tag == "Carrot" && !activeHyperBoost) { warning.SetActive(true); StartCoroutine("HyperBoost"); Destroy(c.gameObject); } }
void OnTriggerEnter2D(Collider2D c) { soul = GetComponent <Soul>(); if (c.tag == "SpectrumRectsH") { vel.x = vel.x * -1; } if (c.tag == "SpectrumRectsV") { vel.y = vel.y * -1; } if (c.tag == "Boost" && canmove == false) { Life = Life - 1; soul.Explosion(); if (Life <= 0) { if (isEvent) { soul.Explosion(); Destroy(gameObject); } else { AddPoints(100); soul.Explosion(); playeRef.GetComponent <Player> ().SpectroBattleFinisher(); this.gameObject.SetActive(false); } } } else if (c.tag == "Player") { GameObject.Destroy(c.gameObject); soul.Explosion(); } }