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

        if (controller != null)
        {
            controller.AddCogs();
            controller.PlaySound(collectedClip);
            Destroy(gameObject);
        }
    }