public virtual void CasingSound() { if (firepoint == null) { return; } AudioHandler.AudioContext adjustedContext = casingAudioContext; adjustedContext.volume *= SettingsHandler.cache.volume_gun * SettingsHandler.cache.volume_master; AudioHandler.PlaySound(casingDenominator + Random.Range(1, 21).ToString("D2"), adjustedContext, firepoint.position.Mult(new Vector3(1f, 0f, 1f))); }
internal void HandleFire(float overshotTime) { Fire(overshotTime); ammo--; if (shootSounds.Count > 0) { AudioHandler.AudioContext adjustedContext = audioContext; adjustedContext.volume *= SettingsHandler.cache.volume_gun * SettingsHandler.cache.volume_master; AudioHandler.PlaySound(shootSounds[Random.Range(0, shootSounds.Count - 1)], adjustedContext, firepoint.position); } OnFire?.Invoke(); CalculateCooldown(); }
private void Sound(string name, Vector3 position, AudioHandler.AudioContext context) { if (HighscoreHandler.instance.transform.GetChild(0).gameObject.activeSelf) { return; } AudioHandler.AudioContext modifiedContext = context; modifiedContext.volume *= SettingsHandler.cache.volume_master * SettingsHandler.cache.volume_zombie; if (!playing) { modifiedContext.volume *= .3f; modifiedContext.minPitch *= .85f; modifiedContext.maxPitch *= .85f; } AudioHandler.PlaySound(name, modifiedContext, position); }
public static void Apply(this AudioSource source, AudioHandler.AudioContext context) { source.volume = context.volume; if (context.minPitch == context.maxPitch) { source.pitch = context.minPitch; } else { source.pitch = NormalRandom(context.minPitch, context.maxPitch, 0.1f, Mathf.Infinity); } source.spatialBlend = context.spatialBlend; source.priority = context.priority; }