void OnMouseOver() { if (Input.GetMouseButtonDown(0)) { Destroy(gameObject); Lives.HurtPlayer(pointsToDead); print("Red_Destroy"); } }
void OnCollisionEnter2D(Collision2D coll) { Destroy(GameObject.FindGameObjectWithTag("player")); if (GameObject.FindGameObjectWithTag("player")) { Lives.HurtPlayer(pointsToDead); } // Application.LoadLevel (leveltoload); }
private void OnTriggerEnter2D(Collider2D other) { if (other.CompareTag("Player")) { other.gameObject.SetActive(false); if (respawning == true) { lives.GameOver(); } lives.HurtPlayer(); respawning = true; StartCoroutine(Respawn(other.gameObject)); } }