示例#1
0
    public void ActivatePointsSound()
    {
        SuctionSoundFX pointsSound = Resources.Load <SuctionSoundFX>("prefabs/SoundPrefabs/PointsSound");

        Instantiate(pointsSound);

        //PointsSound
    }
示例#2
0
 void MakeSuctionSound(float delayInSound)
 {
     suctionSound = Resources.Load<SuctionSoundFX> ("prefabs/SoundPrefabs/SuctionSound");
     GameObject suctionSoundGarbage=  GameObject.FindGameObjectWithTag ("SuctionSoundGarbage") as GameObject ;
     if (!suctionSoundGarbage) {
         suctionSoundGarbage=new GameObject();
         suctionSoundGarbage.tag="SuctionSoundGarbage";
     }
     SuctionSoundFX sound=(SuctionSoundFX)Instantiate (suctionSound, new Vector3 (0, 0, 0), Quaternion.identity);
     sound.transform.parent= suctionSoundGarbage.transform;
 }
示例#3
0
    void MakeHitSound(float delayInSound)
    {
        SuctionSoundFX hitSound            = Resources.Load <SuctionSoundFX> ("prefabs/SoundPrefabs/HitSound");
        GameObject     suctionSoundGarbage = GameObject.FindGameObjectWithTag("SuctionSoundGarbage") as GameObject;

        if (!suctionSoundGarbage)
        {
            suctionSoundGarbage     = new GameObject();
            suctionSoundGarbage.tag = "SuctionSoundGarbage";
        }
        SuctionSoundFX sound = (SuctionSoundFX)Instantiate(hitSound, new Vector3(0, 0, 0), Quaternion.identity);

        sound.transform.parent = suctionSoundGarbage.transform;
    }