Esempio n. 1
0
    public void PickUp(GameObject itemToPickUp)
    {
        // Debug.Log("At least the PickUp function is calling.");
        if (itemToPickUp.tag == "Marble")
        {
            marbles = marbles + 1;
            // Debug.Log("Player picked up a marble");
            Destroy(itemToPickUp);
            marbleCountTMP.SetText($"{marbles}");

            // DOSpiral
            // transform.DOSpiral(3, Vector3.forward, SpiralMode.ExpandThenContract, 1, 10);

            persistentSFX.PlayMarbleSFX();
        }

        if (itemToPickUp.tag == "BrambleStone")
        {
            brambleStones = brambleStones + 1;
            Debug.Log("Player picked up BrambleStone");
            Destroy(itemToPickUp);
            brambleStoneCountTMP.SetText($"{brambleStones}");

            persistentSFX.PlayBrambleStoneSFX();
        }

        if (itemToPickUp.tag == "Essence")
        {
            essence = essence + 1;
            Debug.Log("Player picked up Essence");
            Destroy(itemToPickUp);
            essenceCountTMP.SetText($"{essence}");
            persistentSFX.PlayEssenceSFX();
        }

        if (itemToPickUp.tag == "JingleBell")
        {
            jingleBellGameObject = GameObject.FindWithTag("JingleBell");
            jingleBellEquip      = jingleBellGameObject.GetComponent <EquipItem>();
            jingleBell           = true;
            Debug.Log("Player picked up JingleBell");
            jingleBellEquip.EquipPickup();
            Destroy(itemToPickUp);

            persistentSFX.PlayJingleBellSFX();
        }
    }