예제 #1
0
    void OnTriggerEnter2D(Collider2D collision)
    {
        RubyController controller = collision.GetComponent <RubyController>();

        if (controller != null)
        {
            controller.AddAmmo(11);
            Destroy(gameObject);

            controller.PlaySound(collectedClip);
        }
    }