private void OnCollisionEnter2D(Collision2D collision) { Playar temp = collision.transform?.GetComponent <Playar>(); if (temp != null) { temp.StartBigPlayar(); Destroy(gameObject); } }
private void OnTriggerEnter2D(Collider2D collision) { Playar temp = collision?.GetComponent <Playar>(); if (temp != null) { if (temp.EatMashrim == false) { temp.StartBigPlayar(); } else { temp.StartFlowerPlayar(); } Destroy(gameObject); } }