Exemple #1
0
    private void OnTriggerEnter2D(Collider2D other)
    {
        RubyController controller = other.GetComponent <RubyController>();

        if (controller != null)
        {
            if (controller.currentAmmo < controller.maxAmmo)
            {
                controller.PickEffect();
                controller.PlaySound(collectedClip);
                controller.ChangeAmmoAmount(ammoAmount);

                Destroy(gameObject);
            }
        }
    }