private void OnCollisionEnter2D(Collision2D collision) { var powerup = collision.gameObject.GetComponent <Powerup>(); if (powerup != null) { Speed += powerup.Speed; BagCain.AddChain(powerup.Chain); if (powerup.Speed > 0) { Popup.CreatePopup(powerup.Speed, powerup); } if (powerup.Chain > 0) { Popup.CreatePopup(powerup.Chain, powerup); } Destroy(powerup.gameObject); } }