public void ActivatePointsSound() { SuctionSoundFX pointsSound = Resources.Load <SuctionSoundFX>("prefabs/SoundPrefabs/PointsSound"); Instantiate(pointsSound); //PointsSound }
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; }
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; }