Exemple #1
0
        private void ProcessExteriorSound()
        {
            if (SourceEntity is Vehicle is false)
            {
                return;
            }

            if (IsExteriorSound is false)
            {
                return;
            }

            // If player is in the source vehicle and use 3rd person mode we use original sound volume
            if (Main.PlayerVehicle == SourceEntity == false || CameraUtils.IsPlayerUseFirstPerson() == false)
            {
                SoundInstances.ForEach(x => x.Volume = _originalVolume);
                return;
            }

            // Define volume based on is car doors open / closed
            SoundInstances.ForEach(x => x.Volume =
                                       VehicleUtils.IsAnyOfFrontDoorsOpen((Vehicle)SourceEntity) ? _originalVolume : _originalVolume / 2);
        }
Exemple #2
0
        private void ProcessInteriorSound()
        {
            if (SourceEntity is Vehicle is false)
            {
                return;
            }

            if (IsInteriorSound is false)
            {
                return;
            }

            // If player is in the source vehicle we use original sound volume
            if (Main.PlayerVehicle == SourceEntity)
            {
                SoundInstances.ForEach(x => x.Volume = _originalVolume);
                return;
            }

            // Define volume based on is car doors open / closed
            SoundInstances.ForEach(x => x.Volume =
                                       VehicleUtils.IsAnyOfFrontDoorsOpen((Vehicle)SourceEntity) ? _originalVolume : _originalVolume / 4);
        }