Example #1
0
 private void PlaySound(LaserBeam anyBeam, AudioClip clip)
 {
     if (!anyBeam)
     {
         clip.PlayLocal(base.itemRep.transform, Vector3.zero, 1f, AudioRolloffMode.Logarithmic, 1f, 4f);
     }
     else
     {
         clip.PlayLocal(anyBeam.transform, Vector3.zero, 1f, AudioRolloffMode.Logarithmic, 1f, 4f);
     }
 }
Example #2
0
 // Token: 0x06003A59 RID: 14937 RVA: 0x000CCF1C File Offset: 0x000CB11C
 private void PlaySound(Light anyLight, AudioClip clip)
 {
     if (anyLight)
     {
         clip.PlayLocal(anyLight.transform, Vector3.zero, 1f, 0, 1f, 4f);
     }
     else
     {
         clip.PlayLocal(base.itemRep.transform, Vector3.zero, 1f, 0, 1f, 4f);
     }
 }
 // Token: 0x06003A65 RID: 14949 RVA: 0x000CD0D4 File Offset: 0x000CB2D4
 private void PlaySound(global::LaserBeam anyBeam, AudioClip clip)
 {
     if (anyBeam)
     {
         clip.PlayLocal(anyBeam.transform, Vector3.zero, 1f, 0, 1f, 4f);
     }
     else
     {
         clip.PlayLocal(base.itemRep.transform, Vector3.zero, 1f, 0, 1f, 4f);
     }
 }
Example #4
0
 private void PlaySound(Light anyLight, AudioClip clip)
 {
     if (anyLight != null)
     {
         clip.PlayLocal(anyLight.transform, Vector3.zero, 1f, AudioRolloffMode.Logarithmic, 1f, 4f);
     }
     else
     {
         clip.PlayLocal(base.itemRep.transform, Vector3.zero, 1f, AudioRolloffMode.Logarithmic, 1f, 4f);
     }
 }
Example #5
0
    // Token: 0x0600363D RID: 13885 RVA: 0x000C54D0 File Offset: 0x000C36D0
    public virtual void Local_BeginStrikes(int numStrikes, global::ViewModel vm, global::ItemRepresentation itemRep, global::IStrikeGunItem itemInstance, ref global::HumanController.InputSample sample)
    {
        string name = "strike" + numStrikes;

        vm.Play(name, 4);
        AudioClip clip = this.strikeSounds[numStrikes - 1];

        clip.PlayLocal(Camera.main.transform, Vector3.zero, 1f, Random.Range(0.96f, 1.03f), 2f, 2f, 0);
    }
Example #6
0
    public virtual void Local_BeginStrikes(int numStrikes, ViewModel vm, ItemRepresentation itemRep, IStrikeGunItem itemInstance, ref HumanController.InputSample sample)
    {
        string str = string.Concat("strike", numStrikes);

        vm.Play(str, PlayMode.StopAll);
        AudioClip audioClip = this.strikeSounds[numStrikes - 1];

        audioClip.PlayLocal(Camera.main.transform, Vector3.zero, 1f, UnityEngine.Random.Range(0.96f, 1.03f), 2f, 2f, 0);
    }
    // Token: 0x06002B5D RID: 11101 RVA: 0x000A1468 File Offset: 0x0009F668
    protected override bool PlaySnd(int type)
    {
        AudioClip audioClip   = null;
        float     volume      = 1f;
        float     minDistance = 5f;
        float     maxDistance = 20f;
        bool      flag        = false;

        if (type == 5)
        {
            if (this.chaseSoundsFar != null)
            {
                audioClip = this.chaseSoundsFar[Random.Range(0, this.chaseSoundsFar.Length)];
            }
            volume      = 1f;
            minDistance = 0.25f;
            maxDistance = 25f;
            flag        = true;
        }
        else if (type == 6)
        {
            if (this.chaseSoundsClose != null)
            {
                audioClip = this.chaseSoundsClose[Random.Range(0, this.chaseSoundsClose.Length)];
            }
            volume      = 1f;
            minDistance = 0f;
            maxDistance = 10f;
            flag        = true;
        }
        else if (type == 2)
        {
            if (this.attackSounds != null)
            {
                audioClip = this.attackSounds[Random.Range(0, this.attackSounds.Length)];
            }
            volume      = 1f;
            minDistance = 0f;
            maxDistance = 10f;
            flag        = true;
        }
        if (audioClip && flag)
        {
            audioClip.PlayLocal(base.transform, Vector3.zero, volume, minDistance, maxDistance);
            return(true);
        }
        return(base.PlaySnd(type));
    }
Example #8
0
    protected override bool PlaySnd(int type)
    {
        AudioClip item    = null;
        float     single  = 1f;
        float     single1 = 5f;
        float     single2 = 20f;
        bool      flag    = false;

        if (type == 5)
        {
            if (this.chaseSoundsFar != null)
            {
                item = this.chaseSoundsFar[UnityEngine.Random.Range(0, this.chaseSoundsFar.Length)];
            }
            single  = 1f;
            single1 = 0.25f;
            single2 = 25f;
            flag    = true;
        }
        else if (type == 6)
        {
            if (this.chaseSoundsClose != null)
            {
                item = this.chaseSoundsClose[UnityEngine.Random.Range(0, this.chaseSoundsClose.Length)];
            }
            single  = 1f;
            single1 = 0f;
            single2 = 10f;
            flag    = true;
        }
        else if (type == 2)
        {
            if (this.attackSounds != null)
            {
                item = this.attackSounds[UnityEngine.Random.Range(0, this.attackSounds.Length)];
            }
            single  = 1f;
            single1 = 0f;
            single2 = 10f;
            flag    = true;
        }
        if (!item || !flag)
        {
            return(base.PlaySnd(type));
        }
        item.PlayLocal(base.transform, Vector3.zero, single, single1, single2);
        return(true);
    }
    // Token: 0x06002B42 RID: 11074 RVA: 0x000A0D44 File Offset: 0x0009EF44
    protected virtual bool PlaySnd(int type)
    {
        AudioClip audioClip = null;
        float     volume;
        float     minDistance;
        float     maxDistance;

        if (type == 0)
        {
            if (this.idleSounds != null)
            {
                audioClip = this.idleSounds[Random.Range(0, this.idleSounds.Length)];
            }
            volume      = 0.4f;
            minDistance = 0.25f;
            maxDistance = 8f;
        }
        else if (type == 3)
        {
            if (this.fleeStartSounds != null)
            {
                audioClip = this.fleeStartSounds[Random.Range(0, this.fleeStartSounds.Length)];
            }
            volume      = 0.9f;
            minDistance = 1.25f;
            maxDistance = 10f;
        }
        else
        {
            if (type != 4)
            {
                return(false);
            }
            if (this.deathSounds != null)
            {
                audioClip = this.deathSounds[Random.Range(0, this.deathSounds.Length)];
            }
            volume      = 1f;
            minDistance = 2.25f;
            maxDistance = 20f;
        }
        if (audioClip)
        {
            audioClip.PlayLocal(this.transform, Vector3.zero, volume, minDistance, maxDistance);
        }
        return(true);
    }
Example #10
0
    protected virtual bool PlaySnd(int type)
    {
        AudioClip item    = null;
        float     single  = 1f;
        float     single1 = 5f;
        float     single2 = 20f;

        if (type == 0)
        {
            if (this.idleSounds != null)
            {
                item = this.idleSounds[UnityEngine.Random.Range(0, this.idleSounds.Length)];
            }
            single  = 0.4f;
            single1 = 0.25f;
            single2 = 8f;
        }
        else if (type != 3)
        {
            if (type != 4)
            {
                return(false);
            }
            if (this.deathSounds != null)
            {
                item = this.deathSounds[UnityEngine.Random.Range(0, this.deathSounds.Length)];
            }
            single  = 1f;
            single1 = 2.25f;
            single2 = 20f;
        }
        else
        {
            if (this.fleeStartSounds != null)
            {
                item = this.fleeStartSounds[UnityEngine.Random.Range(0, this.fleeStartSounds.Length)];
            }
            single  = 0.9f;
            single1 = 1.25f;
            single2 = 10f;
        }
        if (item)
        {
            item.PlayLocal(this.transform, Vector3.zero, single, single1, single2);
        }
        return(true);
    }
    public virtual void PlayFireSound(Transform soundTransform, bool firstPerson, ItemRepresentation itemRep)
    {
        bool      flag                 = this.IsSilenced(itemRep);
        AudioClip fireSound            = this.GetFireSound(itemRep);
        float     single               = Vector3.Distance(soundTransform.position, Camera.main.transform.position);
        float     farFireSoundRangeMin = this.GetFarFireSoundRangeMin();

        fireSound.PlayLocal(soundTransform, Vector3.zero, 1f, UnityEngine.Random.Range(0.92f, 1.08f), this.GetFireSoundRangeMin(), this.GetFireSoundRangeMax() * (!flag ? 1f : 1.5f), (!firstPerson ? 20 : 0));
        if (!firstPerson && single > farFireSoundRangeMin && !flag)
        {
            AudioClip farFireSound = this.GetFarFireSound(itemRep);
            if (farFireSound)
            {
                farFireSound.PlayLocal(soundTransform, Vector3.zero, 1f, UnityEngine.Random.Range(0.9f, 1.1f), 0f, this.GetFarFireSoundRangeMax(), 50);
            }
        }
    }
Example #12
0
    public virtual void PlayFireSound(Transform soundTransform, bool firstPerson, ItemRepresentation itemRep)
    {
        bool      flag                 = this.IsSilenced(itemRep);
        AudioClip fireSound            = this.GetFireSound(itemRep);
        float     num                  = Vector3.Distance(soundTransform.position, Camera.main.transform.position);
        float     farFireSoundRangeMin = this.GetFarFireSoundRangeMin();

        fireSound.PlayLocal(soundTransform, Vector3.zero, 1f, Random.Range((float)0.92f, (float)1.08f), this.GetFireSoundRangeMin(), this.GetFireSoundRangeMax() * (!flag ? 1f : 1.5f), !firstPerson ? 20 : 0);
        if ((!firstPerson && (num > farFireSoundRangeMin)) && !flag)
        {
            AudioClip farFireSound = this.GetFarFireSound(itemRep);
            if (farFireSound != null)
            {
                farFireSound.PlayLocal(soundTransform, Vector3.zero, 1f, Random.Range((float)0.9f, (float)1.1f), 0f, this.GetFarFireSoundRangeMax(), 50);
            }
        }
    }