private void OnTriggerEnter2D(Collider2D collision) { if (!hasCollided && collision.gameObject.layer == LayerMask.NameToLayer("Player")) { gameBrain.OnGameComplete(); hasCollided = true; } }