예제 #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();
            }
        }
예제 #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();
     }
 }
예제 #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);
        }
예제 #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);
        }
예제 #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;
 }
예제 #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);
        }
예제 #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);
        }
예제 #8
0
 public void PlayWoodCrash(Vector3 pos)
 {
     PoolManager.Spawn(sounds[(int)soundIndx.woodCrash], pos, Quaternion.identity);
 }
예제 #9
0
        public void PlayWoodHit(Vector3 pos)
        {
            int selector = Random.Range(0, 2);

            PoolManager.Spawn(sounds[(int)soundIndx.woodHit1 + selector], pos, Quaternion.identity);
        }
예제 #10
0
 public void PlayEmptyShoot(Vector3 pos)
 {
     PoolManager.Spawn(sounds[(int)soundIndx.emptyShoot], pos, Quaternion.identity);
 }
예제 #11
0
 public void PlayMetalStrike(Vector3 pos)
 {
     PoolManager.Spawn(sounds[(int)soundIndx.metalStrike], pos, Quaternion.identity);
 }
예제 #12
0
 public void PlayGranadaLauncher(Vector3 pos)
 {
     PoolManager.Spawn(sounds[(int)soundIndx.granadeLauncher], pos, Quaternion.identity);
 }
예제 #13
0
 public void PlayExplosion(Vector3 pos)
 {
     PoolManager.Spawn(sounds[(int)soundIndx.explosion], pos, Quaternion.identity);
 }
예제 #14
0
 public void PlayIndexedSound(int i, Vector3 pos)
 {
     PoolManager.Spawn(sounds[i], pos, Quaternion.identity);
 }