/// <summary> /// Destroy player and game is over /// </summary> /// <param name="other"> The object that collided with player </param> void OnCollisionEnter2D(Collision2D other) { Debug.Log("Player Collided with " + other.gameObject.name); Destroy(this.gameObject); Instantiate(explosionEffect, this.transform.position, Quaternion.identity); uiManager.CheckForHighScore(); uiManager.LoseGame(); }