コード例 #1
0
 void OnTriggerEnter(Collider other)
 {
     if (other.name == "Player")
     {
         callOwl.Owl();
         callCollectSound.OwlCollect();
         //gameObject.SetActive(false);
         Destroy(gameObject);
     }
 }
コード例 #2
0
    void OnTriggerEnter(Collider other)
    {
        if (other.tag == "Player" && pickedUp == false)
        {
            pickedUp = true;
            callOwl.Owl();                  //Ger score
            callCollectSound.OwlCollect();  //spelar upp jingle
            FollowPlayer();
            //spela upp collect ljud
            //gameObject.SetActive(false);
            //Destroy(gameObject);            //dödar objektet

            if (owlTrummor)
            {
                owlAdvance.Trummor();
            }
            if (owlGitarr)
            {
                owlAdvance.Gitarr();
            }
            if (owlPiano)
            {
                owlAdvance.Piano();
            }
            if (owlBas)
            {
                owlAdvance.Bas();
            }
            if (owlBanjo)
            {
                owlAdvance.Banjo();
            }
            if (owlTrumpet)
            {
                owlAdvance.Trumpet();
            }
            if (owlOrgel)
            {
                owlAdvance.Orgel();
            }
        }
    }