void OnTriggerEnter2D(Collider2D collision) { RubyController controller = collision.GetComponent <RubyController>(); if (controller != null) { controller.AddAmmo(11); Destroy(gameObject); controller.PlaySound(collectedClip); } }