Beispiel #1
0
    private void OnTriggerEnter(Collider other)
    {
        PlayerInventory inventory = other.attachedRigidbody.GetComponent <PlayerInventory>();

        if (inventory != null)
        {
            // we found the inventory!
            inventory.AddCollectible();
            PlayFX();
        }

        // disable relevant components for "Collection"
        triggerToDisable.enabled = false;
        artToDisable.SetActive(false);
    }