void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.tag == "Player") { Debug.Log("Hit player"); respawn.Reload(); } }
// Update is called once per frame void Update() { countdownText.text = ("Time Left = " + timeLeft); if (timeLeft <= 0) { StopCoroutine("LoseTime"); respawn.Reload(); } }
void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.tag == "Player") { Debug.Log("Hit player"); respawn.Reload(); } if (collision.gameObject.tag == "environment") { a = TriggerZone.GetComponent <TriggerFall>(); a.fall = 2; Destroy(gameObject); } }
void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.tag == "enemy") { Destroy(collision.gameObject); } else if (collision.gameObject.tag == "Player") { respawn.Reload(); } else if (collision.gameObject.tag == "environment") { Destroy(gameObject); } }
void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.tag == "enemy") { Destroy(collision.gameObject); } else if (collision.gameObject.tag == "Player") { respawn.Reload(); } else if (collision.gameObject.tag == "environment") { // Destroy(collision.gameObject); } else if (collision.gameObject.tag == "CrushBlock") { transform.Translate(Vector3.down * Time.deltaTime * slowSpeed); count = slowingTime; } }