Exemple #1
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        var rb = collision.attachedRigidbody;

        if (rb.gameObject.tag == "PickupSub")
        {
            rb.gameObject.tag = "Done";
            Debug.Log("Score!");
            Destroy(rb.gameObject, 0.5f);
            sb.BroadcastMessage("GainFuel", 2000f);
        }
    }