private void OnTriggerEnter2D(Collider2D collider) { if (collider.tag == GameConstant.ITEM_TAG) { Destroy(collider.gameObject); gameStage.DestroyItem(); } }
private void OnCollisionEnter2D(Collision2D col) { if (col.gameObject.tag == GameConstant.POLYGON_TAG) { if (!isColldied) { isColldied = true; spriteRender.color = Color.red; gameStage.DestroyItem(); } } }
void OnCollisionEnter2D(Collision2D coll) { if (coll.gameObject.tag == GameConstant.POLYGON_TAG) { if (!isCollided) { if (spriteRender != null) { spriteRender.color = Color.red; } gameStage.DestroyItem(); isCollided = true; } } }