Beispiel #1
0
        public void Reload()
        {
            AudioSource source = GetAudioSource();

            source.pitch = reloadingAudio.GetPitch();
            source.clip  = reloadingAudio.GetClip();
            source.Play();
        }
Beispiel #2
0
        private void OnDestroy()
        {
            GameObject  obj    = GameManager.GetObjectPooler().RequestObject("FragExplosion");
            AudioSource source = obj.AddComponent <AudioSource>();

            source.pitch        = explosionAudio.GetPitch();
            source.clip         = explosionAudio.GetClip();
            source.spatialBlend = 1;
            source.Play();
            obj.transform.position = transform.position;
        }
Beispiel #3
0
        public void Shoot()
        {
            isShooting = true;

            AudioSource source = GetAudioSource();

            source.pitch = shootingAudio.GetPitch();
            source.clip  = shootingAudio.GetClip();
            source.Play();

            if (particles != null)
            {
                for (int i = 0; i < particles.Length; i++)
                {
                    particles[i].Play();
                }
            }
        }