void OnTriggerEnter2D(Collider2D collider) { GameObject hitObj = collider.gameObject; if (hitObj.tag == "Player") { win.SetWinState(true); } }