Example #1
0
        public void PlayMusic(Sounds clip)
        {
            if (!cam)
            {
                cam = Camera.main;
            }
            int index = Random.Range(clipIndex[(int)clip], clipIndex[(int)clip] + groupSizes[(int)clip]);

            if (!GameObject.Find("jukebox"))
            {
                Transform jukebox = PoolManager.Spawn(audioDad, cam.transform.position, Quaternion.identity);
                jukebox.parent          = cam.transform;
                jukebox.gameObject.name = "jukebox";
                AudioSource temp = jukebox.GetComponent <AudioSource>();
                temp.clip   = clips[(int)clip];
                temp.loop   = true;
                temp.volume = Manager_Static.GeneralVolumen / 100;
                temp.Play();
            }
            else
            {
                AudioSource temp = GameObject.Find("jukebox").GetComponent <AudioSource>();
                temp.clip   = clips[(int)clip];
                temp.volume = Manager_Static.GeneralVolumen / 100;
                temp.Play();
            }
        }
Example #2
0
 public void PlayMusic(AudioClip clip)
 {
     if (!cam)
     {
         cam = Camera.main;
     }
     if (!GameObject.Find("jukebox"))
     {
         Transform jukebox = PoolManager.Spawn(audioDad, cam.transform.position, Quaternion.identity);
         jukebox.parent          = cam.transform;
         jukebox.gameObject.name = "jukebox";
         AudioSource temp = jukebox.GetComponent <AudioSource>();
         temp.clip   = clip;
         temp.loop   = true;
         temp.volume = Manager_Static.GeneralVolumen / 100;
         temp.Play();
     }
     else
     {
         AudioSource temp = GameObject.Find("jukebox").GetComponent <AudioSource>();
         temp.clip   = clip;
         temp.volume = Manager_Static.GeneralVolumen / 100;
         temp.Play();
     }
 }
Example #3
0
        public void PlaySoundAt(Vector3 pos, AudioClip clip)
        {
            Transform   sound = PoolManager.Spawn(audioDad, pos, Quaternion.identity);
            AudioSource temp  = sound.GetComponent <AudioSource>();

            temp.volume = Manager_Static.GeneralVolumen / 100;
            temp.clip   = clip;
            temp.PlayOneShot(clip);
            sound.GetComponent <AudioDad>().Despawn(clip.length);
        }
Example #4
0
        public void PlaySoundAt(Vector3 pos, Sounds clip)
        {
            int index = Random.Range(clipIndex[(int)clip], clipIndex[(int)clip] + groupSizes[(int)clip]);

            Transform   sound = PoolManager.Spawn(audioDad, pos, Quaternion.identity);
            AudioSource temp  = sound.GetComponent <AudioSource>();

            temp.volume = Manager_Static.GeneralVolumen / 100;
            temp.PlayOneShot(clips[index]);
            sound.GetComponent <AudioDad>().Despawn(clips[index].length);
        }
Example #5
0
 private void Update()
 {
     if (cooldownMeteor < 0.0f)
     {
         PoolManager.Spawn(meteor, meteor.transform.position, Quaternion.identity);
         MakeNewCooldownMeteor();
     }
     if (cooldownBlackHole < 0.0f)
     {
         blackHole.GetComponent <Animator>().SetTrigger("MakeAnimation");
         MakeNewCooldownBlackHole();
     }
     cooldownMeteor    -= Time.deltaTime;
     cooldownBlackHole -= Time.deltaTime;
 }
Example #6
0
        public void PlaySoundGlobal(AudioClip clip)
        {
            if (!cam)
            {
                cam = Camera.main;
            }
            Transform sound = PoolManager.Spawn(audioDad, cam.transform.position, Quaternion.identity);

            sound.parent = cam.transform;
            AudioSource temp = sound.GetComponent <AudioSource>();

            temp.volume = Manager_Static.GeneralVolumen / 100;
            temp.PlayOneShot(clip);
            sound.GetComponent <AudioDad>().Despawn(clip.length);
        }
Example #7
0
        public void PlaySoundGlobal(Sounds clip)
        {
            if (!cam)
            {
                cam = Camera.main;
            }
            Debug.Log((int)clip);
            Debug.Log(clipIndex.Length);
            int       index = Random.Range(clipIndex[(int)clip], clipIndex[(int)clip] + groupSizes[(int)clip]);
            Transform sound = PoolManager.Spawn(audioDad, cam.transform.position, Quaternion.identity);

            sound.parent = cam.transform;
            AudioSource temp = sound.GetComponent <AudioSource>();

            temp.volume = Manager_Static.GeneralVolumen / 100;
            temp.PlayOneShot(clips[index]);
            sound.GetComponent <AudioDad>().Despawn(clips[index].length);
        }
 public void PlayWoodCrash(Vector3 pos)
 {
     PoolManager.Spawn(sounds[(int)soundIndx.woodCrash], pos, Quaternion.identity);
 }
        public void PlayWoodHit(Vector3 pos)
        {
            int selector = Random.Range(0, 2);

            PoolManager.Spawn(sounds[(int)soundIndx.woodHit1 + selector], pos, Quaternion.identity);
        }
 public void PlayEmptyShoot(Vector3 pos)
 {
     PoolManager.Spawn(sounds[(int)soundIndx.emptyShoot], pos, Quaternion.identity);
 }
 public void PlayMetalStrike(Vector3 pos)
 {
     PoolManager.Spawn(sounds[(int)soundIndx.metalStrike], pos, Quaternion.identity);
 }
 public void PlayGranadaLauncher(Vector3 pos)
 {
     PoolManager.Spawn(sounds[(int)soundIndx.granadeLauncher], pos, Quaternion.identity);
 }
 public void PlayExplosion(Vector3 pos)
 {
     PoolManager.Spawn(sounds[(int)soundIndx.explosion], pos, Quaternion.identity);
 }
 public void PlayIndexedSound(int i, Vector3 pos)
 {
     PoolManager.Spawn(sounds[i], pos, Quaternion.identity);
 }