Decompiled source of ItemSpawner v1.0.0
SpawnItems.dll
Decompiled 2 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.CodeDom.Compiler; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Text; using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; using Audial.Utils; using ExitGames.Client.Photon; using LeastSquares.Overtone; using Overtone.Scripts; using Photon.Pun; using Photon.Pun.UtilityScripts; using Photon.Realtime; using Photon.Voice; using Photon.Voice.PUN; using Photon.Voice.Unity; using Steamworks; using Steamworks.Data; using Strobotnik.Klattersynth; using TMPro; using Unity.AI.Navigation; using Unity.VisualScripting; using UnityEngine; using UnityEngine.AI; using UnityEngine.Animations; using UnityEngine.Audio; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Utilities; using UnityEngine.Rendering; using UnityEngine.Rendering.PostProcessing; using UnityEngine.SceneManagement; using UnityEngine.Serialization; using UnityEngine.UI; using UnityEngine.Video; using WebSocketSharp; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyVersion("0.0.0.0")] public class AmbienceBreakers : MonoBehaviour { public static AmbienceBreakers instance; private PhotonView photonView; private bool isLocal; [Space] public float minDistance = 8f; public float maxDistance = 15f; [Space] public float cooldownMin = 20f; public float cooldownMax = 120f; private float cooldownTimer; [Space] public Sound sound; private int presetOverride = -1; private int breakerOverride = -1; private float updateRate = 0.5f; private void Awake() { instance = this; photonView = ((Component)this).GetComponent<PhotonView>(); } private void Start() { if (!GameManager.Multiplayer() || PhotonNetwork.IsMasterClient) { isLocal = true; } } public void Setup() { ((MonoBehaviour)this).StopAllCoroutines(); ((MonoBehaviour)this).StartCoroutine(Logic()); } private IEnumerator Logic() { while (!LevelGenerator.Instance.Generated) { yield return (object)new WaitForSeconds(0.1f); } cooldownTimer = Random.Range(cooldownMin, cooldownMax); if (!isLocal) { yield break; } while (true) { if (cooldownTimer > 0f) { cooldownTimer -= updateRate; } else { cooldownTimer = Random.Range(cooldownMin, cooldownMax); Vector2 insideUnitCircle = Random.insideUnitCircle; Vector2 normalized = ((Vector2)(ref insideUnitCircle)).normalized; float num = Random.Range(minDistance, maxDistance); Vector3 val = ((Component)GameDirector.instance.PlayerList[Random.Range(0, GameDirector.instance.PlayerList.Count)]).transform.position + new Vector3(normalized.x, 0f, normalized.y) * num; int num2 = Random.Range(0, LevelGenerator.Instance.Level.AmbiencePresets.Count); if (presetOverride != -1) { num2 = presetOverride; } presetOverride = -1; if (LevelGenerator.Instance.Level.AmbiencePresets[num2].breakers.Count > 0) { int num3 = Random.Range(0, LevelGenerator.Instance.Level.AmbiencePresets[num2].breakers.Count); if (breakerOverride != -1) { num3 = breakerOverride; } breakerOverride = -1; if (!GameManager.Multiplayer()) { PlaySoundRPC(val, num2, num3); } else { photonView.RPC("PlaySoundRPC", (RpcTarget)0, new object[3] { val, num2, num3 }); } } } yield return (object)new WaitForSeconds(updateRate); } } public void LiveTest(LevelAmbience _presetOverride, LevelAmbienceBreaker _breakerOverride) { foreach (LevelAmbience ambiencePreset in LevelGenerator.Instance.Level.AmbiencePresets) { if (!((Object)(object)ambiencePreset == (Object)(object)_presetOverride)) { continue; } presetOverride = LevelGenerator.Instance.Level.AmbiencePresets.IndexOf(ambiencePreset); foreach (LevelAmbienceBreaker breaker in ambiencePreset.breakers) { if (breaker == _breakerOverride) { breakerOverride = ambiencePreset.breakers.IndexOf(breaker); } } } cooldownTimer = 0f; } [PunRPC] public void PlaySoundRPC(Vector3 _position, int _preset, int _breaker) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) LevelAmbienceBreaker levelAmbienceBreaker = LevelGenerator.Instance.Level.AmbiencePresets[_preset].breakers[_breaker]; sound.Volume = levelAmbienceBreaker.volume; sound.Sounds[0] = levelAmbienceBreaker.sound; sound.Play(_position); } } [CreateAssetMenu(fileName = "Level Ambience - _____", menuName = "Level/Level Ambience", order = 2)] public class LevelAmbience : ScriptableObject { public AudioClip loopClip; [Range(0f, 1f)] public float loopVolume = 0.5f; [Space(20f)] public List<LevelAmbienceBreaker> breakers; private void OnValidate() { if (SemiFunc.OnValidateCheck()) { return; } foreach (LevelAmbienceBreaker breaker in breakers) { if (Object.op_Implicit((Object)(object)breaker.sound)) { breaker.name = ((Object)breaker.sound).name.ToUpper(); } breaker.ambience = this; } if (Application.isPlaying && Object.op_Implicit((Object)(object)LevelGenerator.Instance) && LevelGenerator.Instance.Generated) { AmbienceLoop.instance.LiveUpdate(); } } } [Serializable] public class LevelAmbienceBreaker { [HideInInspector] public string name; public AudioClip sound; [Range(0f, 1f)] public float volume = 0.5f; internal LevelAmbience ambience; public void Test() { if (Application.isPlaying) { AmbienceBreakers.instance.LiveTest(ambience, this); } } } public class AmbienceLoop : MonoBehaviour { public static AmbienceLoop instance; public AudioSource source; private AudioClip clip; private float volume; [Space] public AnimationCurve roomCurve; public float roomLerpSpeed = 1f; private float roomLerpAmount; private float roomVolumePrevious; private float roomVolumeCurrent; private RoomAmbience roomAmbience; private void Awake() { instance = this; } private void Update() { if (!LevelGenerator.Instance.Generated) { return; } if (PlayerController.instance.playerAvatarScript.RoomVolumeCheck.CurrentRooms.Count > 0) { RoomAmbience roomAmbience = PlayerController.instance.playerAvatarScript.RoomVolumeCheck.CurrentRooms[0].RoomAmbience; if (Object.op_Implicit((Object)(object)roomAmbience) && (Object)(object)roomAmbience != (Object)(object)this.roomAmbience) { this.roomAmbience = roomAmbience; roomLerpAmount = 0f; roomVolumePrevious = roomVolumeCurrent; } } if (Object.op_Implicit((Object)(object)this.roomAmbience)) { if (roomLerpAmount < 1f) { roomLerpAmount += roomLerpSpeed * Time.deltaTime; float num = roomCurve.Evaluate(roomLerpAmount); roomVolumeCurrent = Mathf.Lerp(roomVolumePrevious, this.roomAmbience.volume, num); } source.volume = volume * roomVolumeCurrent; } } public void Setup() { foreach (LevelAmbience ambiencePreset in LevelGenerator.Instance.Level.AmbiencePresets) { if (Object.op_Implicit((Object)(object)ambiencePreset.loopClip)) { clip = ambiencePreset.loopClip; volume = ambiencePreset.loopVolume; } } source.clip = clip; source.volume = 0f; source.loop = true; source.Play(); } public void LiveUpdate() { foreach (LevelAmbience ambiencePreset in LevelGenerator.Instance.Level.AmbiencePresets) { if (Object.op_Implicit((Object)(object)ambiencePreset.loopClip)) { clip = ambiencePreset.loopClip; volume = ambiencePreset.loopVolume; } } source.volume = volume; } } public class AudioAttack : MonoBehaviour { private void Start() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) AudioSource component = ((Component)this).GetComponent<AudioSource>(); if (Vector3.Distance(((Component)this).transform.position, ((Component)PlayerController.instance).transform.position) < component.maxDistance) { LevelMusic.instance.Interrupt(10f); } EnemyDirector.instance.spawnIdlePauseTimer = 0f; } } public class AudioButtonPushToTalk : MonoBehaviour { public void ButtonPressed() { AudioManager.instance.UpdatePushToTalk(); } } public class AudioManager : MonoBehaviour { public enum AudioType { Default, HighFalloff, Footstep, MaterialImpact, Cutscene, AmbienceBreaker, LowFalloff, Global, HigherFalloff, Attack, Persistent } public enum SoundSnapshot { Off, On, Spectate, CutsceneOnly } public static AudioManager instance; public Transform SoundsParent; public Transform MusicParent; [Space] public AudioMixer MasterMixer; public AudioMixerGroup PersistentSoundGroup; public AudioMixerGroup SoundMasterGroup; public AudioMixerGroup MusicMasterGroup; public AudioMixerGroup MicrophoneSoundGroup; public AudioMixerGroup MicrophoneSpectateGroup; public AudioMixerGroup TTSSoundGroup; public AudioMixerGroup TTSSpectateGroup; public AnimationCurve VolumeCurve; [Space] public AudioListenerFollow AudioListener; [Space] public float lowpassValueMin = 1000f; public float lowpassValueMax = 22000f; public GameObject AudioDefault; public GameObject AudioHighFalloff; public GameObject AudioFootstep; public GameObject AudioMaterialImpact; public GameObject AudioCutscene; public GameObject AudioAmbienceBreaker; public GameObject AudioMaterialSlidingLoop; public GameObject AudioLowFalloff; public GameObject AudioGlobal; public GameObject AudioHigherFalloff; public GameObject AudioAttack; public GameObject AudioPersistent; public AudioMixerSnapshot volumeOff; public AudioMixerSnapshot volumeOn; public AudioMixerSnapshot volumeSpectate; public AudioMixerSnapshot volumeCutsceneOnly; private SoundSnapshot currentSnapshot; internal List<AudioLoopDistance> audioLoopDistances = new List<AudioLoopDistance>(); internal bool pushToTalk; private void Awake() { instance = this; } private void Start() { UpdateAll(); } private void Update() { MasterMixer.SetFloat("Volume", Mathf.Lerp(-80f, 0f, VolumeCurve.Evaluate((float)DataDirector.instance.SettingValueFetch(DataDirector.Setting.MasterVolume) * 0.01f))); MusicMasterGroup.audioMixer.SetFloat("MusicVolume", Mathf.Lerp(-80f, 0f, VolumeCurve.Evaluate((float)DataDirector.instance.SettingValueFetch(DataDirector.Setting.MusicVolume) * 0.01f))); float num = Mathf.Lerp(-80f, 0f, VolumeCurve.Evaluate((float)DataDirector.instance.SettingValueFetch(DataDirector.Setting.SfxVolume) * 0.01f)); SoundMasterGroup.audioMixer.SetFloat("SoundVolume", num); PersistentSoundGroup.audioMixer.SetFloat("PersistentVolume", num); float num2 = Mathf.Lerp(-80f, 0f, VolumeCurve.Evaluate((float)DataDirector.instance.SettingValueFetch(DataDirector.Setting.ProximityVoice) * 0.01f)); MicrophoneSoundGroup.audioMixer.SetFloat("MicrophoneVolume", num2); MicrophoneSpectateGroup.audioMixer.SetFloat("MicrophoneVolume", num2); float num3 = Mathf.Lerp(-80f, 0f, VolumeCurve.Evaluate((float)DataDirector.instance.SettingValueFetch(DataDirector.Setting.TextToSpeechVolume) * 0.01f)); TTSSoundGroup.audioMixer.SetFloat("TTSVolume", num3); TTSSpectateGroup.audioMixer.SetFloat("TTSVolume", num3); } public void UpdateAll() { UpdatePushToTalk(); } public void SetSoundSnapshot(SoundSnapshot _snapShot, float _transitionTime) { if (_snapShot != currentSnapshot) { currentSnapshot = _snapShot; switch (_snapShot) { case SoundSnapshot.Off: volumeOff.TransitionTo(_transitionTime); break; case SoundSnapshot.On: volumeOn.TransitionTo(_transitionTime); break; case SoundSnapshot.Spectate: volumeSpectate.TransitionTo(_transitionTime); break; case SoundSnapshot.CutsceneOnly: volumeCutsceneOnly.TransitionTo(_transitionTime); break; } } } public void RestartAudioLoopDistances() { foreach (AudioLoopDistance audioLoopDistance in audioLoopDistances) { if (((Behaviour)audioLoopDistance).isActiveAndEnabled) { audioLoopDistance.Restart(); } } } public void UpdatePushToTalk() { if (DataDirector.instance.SettingValueFetch(DataDirector.Setting.PushToTalk) == 1) { pushToTalk = true; } else { pushToTalk = false; } } } public class AudioPersistent : MonoBehaviour { private AudioSource audioSource; private void Awake() { audioSource = ((Component)this).GetComponent<AudioSource>(); ((Component)this).transform.parent = null; Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); } private void Update() { if (!audioSource.isPlaying) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public class AudioListenerFollow : MonoBehaviour { public static AudioListenerFollow instance; public Transform TargetPositionTransform; public Transform TargetRotationTransform; private void Awake() { instance = this; } private void Start() { TargetPositionTransform = ((Component)Camera.main).transform; TargetRotationTransform = ((Component)Camera.main).transform; } private void Update() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)TargetPositionTransform)) { if (Object.op_Implicit((Object)(object)SpectateCamera.instance) && SpectateCamera.instance.CheckState(SpectateCamera.State.Death)) { ((Component)this).transform.position = TargetPositionTransform.position; } else { ((Component)this).transform.position = TargetPositionTransform.position + TargetPositionTransform.forward * AssetManager.instance.mainCamera.nearClipPlane; } if (Object.op_Implicit((Object)(object)TargetRotationTransform)) { ((Component)this).transform.rotation = TargetRotationTransform.rotation; } } } } public class AudioLoopDistance : MonoBehaviour { private AudioSource audioSource; private AudioLowPassLogic audioLowPassLogic; private float volumeDefault; public ParticleSystem[] particles; private void Awake() { audioSource = ((Component)this).GetComponent<AudioSource>(); audioLowPassLogic = ((Component)this).GetComponent<AudioLowPassLogic>(); audioLowPassLogic.Setup(); volumeDefault = audioSource.volume; audioSource.volume = 0f; AudioLoopDistanceParticle[] componentsInChildren = ((Component)this).GetComponentsInChildren<AudioLoopDistanceParticle>(); foreach (AudioLoopDistanceParticle audioLoopDistanceParticle in componentsInChildren) { bool flag = false; ParticleSystem[] array = particles; for (int j = 0; j < array.Length; j++) { if ((Object)(object)((Component)array[j]).transform == (Object)(object)((Component)audioLoopDistanceParticle).transform) { flag = true; break; } } if (!flag) { Debug.LogError((object)("Particle not hooked up to Audio: " + ((Object)audioLoopDistanceParticle).name), (Object)(object)((Component)audioLoopDistanceParticle).transform); } } ((MonoBehaviour)this).StartCoroutine(Logic()); } private void Start() { AudioManager.instance.audioLoopDistances.Add(this); } private void OnDestroy() { AudioManager.instance.audioLoopDistances.Remove(this); } public void Restart() { ((MonoBehaviour)this).StopAllCoroutines(); ((MonoBehaviour)this).StartCoroutine(Logic()); } private IEnumerator Logic() { yield return (object)new WaitForSeconds(0.1f); while (true) { float _distance = Vector3.Distance(((Component)AudioManager.instance.AudioListener).transform.position, ((Component)this).transform.position); if (_distance < audioSource.maxDistance + 5f) { if (!audioSource.isPlaying) { audioSource.time = Random.Range(0f, audioSource.clip.length); audioSource.Play(); audioLowPassLogic.Setup(); ParticleSystem[] array = particles; for (int i = 0; i < array.Length; i++) { array[i].Play(); } } while (audioLowPassLogic.Volume < volumeDefault) { audioLowPassLogic.Volume += Time.deltaTime; yield return null; } } else if (audioSource.isPlaying) { while (audioLowPassLogic.Volume > 0f) { audioLowPassLogic.Volume -= Time.deltaTime; yield return null; } audioSource.Stop(); ParticleSystem[] array = particles; for (int i = 0; i < array.Length; i++) { array[i].Stop(); } } if (Mathf.Abs(audioSource.maxDistance - _distance) > 20f) { yield return (object)new WaitForSeconds(Random.Range(3f, 6f)); } else { yield return (object)new WaitForSeconds(Random.Range(0.5f, 2f)); } } } } public class AudioLoopDistanceParticle : MonoBehaviour { } [RequireComponent(typeof(AudioLowPassFilter))] public class AudioLowPassLogic : MonoBehaviour { public bool LowPass; [Space] public bool ForceStart; public bool AlwaysActive; [Space] public bool HasCustomVolume; [Range(0f, 1f)] public float CustomVolume = 0.5f; private float VolumeMultiplier = 0.5f; [Space] public bool HasCustomFalloff; [Range(0f, 1f)] public float CustomFalloff = 0.8f; private float FalloffMultiplier = 0.8f; internal bool Fetch = true; private bool First = true; private bool LogicActive; internal float Falloff; private float LowPassMin; private float LowPassMax; private AudioLowPassFilter AudioLowpassFilter; private AudioSource AudioSource; private LayerMask LayerMask; internal bool volumeFetched; internal float Volume; internal List<Collider> LowPassIgnoreColliders = new List<Collider>(); private Transform audioListener; private void Start() { if (ForceStart) { Setup(); } } public void Setup() { //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) if (Fetch) { audioListener = ((Component)AudioListenerFollow.instance).transform; AudioLowpassFilter = ((Component)this).GetComponent<AudioLowPassFilter>(); AudioSource = ((Component)this).GetComponent<AudioSource>(); LowPassMin = AudioManager.instance.lowpassValueMin; LowPassMax = AudioManager.instance.lowpassValueMax; if (HasCustomFalloff) { FalloffMultiplier = CustomFalloff; } Falloff = AudioSource.maxDistance; LayerMask = LayerMask.op_Implicit(LayerMask.GetMask(new string[3] { "Default", "PhysGrabObject", "PhysGrabObjectHinge" })); if (!volumeFetched) { if (HasCustomVolume) { VolumeMultiplier = CustomVolume; } volumeFetched = true; Volume = AudioSource.volume; } Fetch = false; } CheckStart(); } private void Update() { if (!LogicActive) { return; } if (LowPass) { if (AudioLowpassFilter.cutoffFrequency != LowPassMin || AudioSource.maxDistance != Falloff * FalloffMultiplier || Mathf.Abs(AudioSource.volume - Volume * VolumeMultiplier) > 0.001f) { AudioLowPassFilter audioLowpassFilter = AudioLowpassFilter; audioLowpassFilter.cutoffFrequency -= (LowPassMax - LowPassMin) * 10f * Time.deltaTime; AudioLowpassFilter.cutoffFrequency = Mathf.Clamp(AudioLowpassFilter.cutoffFrequency, LowPassMin, LowPassMax); float num = (AudioLowpassFilter.cutoffFrequency - LowPassMin) / (LowPassMax - LowPassMin); AudioSource.maxDistance = Mathf.Lerp(Falloff * FalloffMultiplier, Falloff, num); AudioSource.volume = Mathf.Lerp(Volume * VolumeMultiplier, Volume, num); } } else if (AudioLowpassFilter.cutoffFrequency != LowPassMax || AudioSource.maxDistance != Falloff || Mathf.Abs(AudioSource.volume - Volume) > 0.001f) { AudioLowPassFilter audioLowpassFilter2 = AudioLowpassFilter; audioLowpassFilter2.cutoffFrequency += (LowPassMax - LowPassMin) * 1f * Time.deltaTime; AudioLowpassFilter.cutoffFrequency = Mathf.Clamp(AudioLowpassFilter.cutoffFrequency, LowPassMin, LowPassMax); float num2 = (AudioLowpassFilter.cutoffFrequency - LowPassMin) / (LowPassMax - LowPassMin); AudioSource.maxDistance = Mathf.Lerp(Falloff * FalloffMultiplier, Falloff, num2); AudioSource.volume = Mathf.Lerp(Volume * VolumeMultiplier, Volume, num2); } First = false; } private void OnEnable() { if (!Fetch) { CheckStart(); } } private void OnDisable() { LogicActive = false; ((MonoBehaviour)this).StopAllCoroutines(); } private void CheckStart() { if (!LogicActive) { First = true; if (((Component)this).gameObject.activeSelf) { ((MonoBehaviour)this).StartCoroutine(Check()); } } } private IEnumerator Check() { LogicActive = true; while (Object.op_Implicit((Object)(object)AudioSource) && (AlwaysActive || !AudioSource.loop || AudioSource.isPlaying || First) && !Fetch) { if (!Object.op_Implicit((Object)(object)audioListener)) { if (!Object.op_Implicit((Object)(object)AudioListenerFollow.instance)) { yield return null; continue; } audioListener = ((Component)AudioListenerFollow.instance).transform; } CheckLogic(); yield return (object)new WaitForSeconds(0.25f); } LogicActive = false; First = true; } private void CheckLogic() { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) LowPass = true; bool flag = Object.op_Implicit((Object)(object)SpectateCamera.instance); if (!Object.op_Implicit((Object)(object)audioListener) || !Object.op_Implicit((Object)(object)AudioSource) || AudioSource.spatialBlend <= 0f || (flag && SpectateCamera.instance.CheckState(SpectateCamera.State.Death))) { LowPass = false; } else { Vector3 val = audioListener.position - ((Component)this).transform.position; if (((Vector3)(ref val)).magnitude < 20f) { LowPass = false; Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, 0.1f, LayerMask.op_Implicit(LayerMask), (QueryTriggerInteraction)2); List<Collider> list = new List<Collider>(); Collider[] array2 = array; foreach (Collider val2 in array2) { if (((Component)((Component)val2).transform).CompareTag("Wall")) { list.Add(val2); } } RaycastHit[] array3 = Physics.RaycastAll(((Component)this).transform.position, val, ((Vector3)(ref val)).magnitude, LayerMask.op_Implicit(LayerMask), (QueryTriggerInteraction)2); for (int i = 0; i < array3.Length; i++) { RaycastHit val3 = array3[i]; if (!((Component)((Component)((RaycastHit)(ref val3)).collider).transform).CompareTag("Wall")) { continue; } bool flag2 = true; foreach (Collider item in list) { if ((Object)(object)((Component)item).transform == (Object)(object)((Component)((RaycastHit)(ref val3)).collider).transform) { flag2 = false; break; } } if (!flag2) { continue; } bool flag3 = false; if (LowPassIgnoreColliders.Count > 0) { foreach (Collider lowPassIgnoreCollider in LowPassIgnoreColliders) { if (Object.op_Implicit((Object)(object)lowPassIgnoreCollider) && (Object)(object)((Component)lowPassIgnoreCollider).transform == (Object)(object)((Component)((RaycastHit)(ref val3)).collider).transform) { flag3 = true; break; } } } if (!flag3) { LowPass = true; break; } } } } if (!First) { return; } if (Object.op_Implicit((Object)(object)AudioSource)) { if (LowPass) { AudioLowpassFilter.cutoffFrequency = LowPassMin; AudioSource.maxDistance = Falloff * FalloffMultiplier; AudioSource.volume = Volume * VolumeMultiplier; } else { AudioLowpassFilter.cutoffFrequency = LowPassMax; AudioSource.maxDistance = Falloff; AudioSource.volume = Volume; } } First = false; } } public class AudioPlay : MonoBehaviour { public AudioSource source; public AudioClip[] sounds; [Range(0f, 1f)] public float volume = 0.5f; [Range(0f, 1f)] public float volumeRandom = 0.1f; [Range(0f, 5f)] public float pitch = 1f; [Range(0f, 2f)] public float pitchRandom = 0.1f; public bool playImpulse; public void Play(float volumeMult) { source.clip = sounds[Random.Range(0, sounds.Length)]; source.volume = (volume + Random.Range(0f - volumeRandom, volumeRandom)) * volumeMult; source.pitch = pitch + Random.Range(0f - pitchRandom, pitchRandom); source.PlayOneShot(source.clip); } public void Update() { if (playImpulse) { Play(1f); playImpulse = false; } } } public class AudioScare : MonoBehaviour { public static AudioScare instance; private AudioSource source; public AudioClip[] impactSounds; public AudioClip[] softSounds; private void Awake() { instance = this; source = ((Component)this).GetComponent<AudioSource>(); } public void PlayImpact() { if (((Behaviour)this).isActiveAndEnabled && GameDirector.instance.currentState == GameDirector.gameState.Main) { LevelMusic.instance.Interrupt(20f); source.volume = 1f; source.clip = impactSounds[Random.Range(0, impactSounds.Length)]; source.Play(); } } public void PlaySoft() { if (((Behaviour)this).isActiveAndEnabled && GameDirector.instance.currentState == GameDirector.gameState.Main) { LevelMusic.instance.Interrupt(20f); source.volume = 1f; source.clip = softSounds[Random.Range(0, softSounds.Length)]; source.Play(); } } public void PlayCustom(AudioClip _sound, float _volume = 0.3f, float _interrupt = 20f) { if (((Behaviour)this).isActiveAndEnabled) { LevelMusic.instance.Interrupt(_interrupt); source.Stop(); source.volume = _volume; source.clip = _sound; source.Play(); } } } [CreateAssetMenu(fileName = "Rarity - _____", menuName = "Other/Rarity Preset", order = 0)] public class RarityPreset : ScriptableObject { [Range(0f, 100f)] public float chance; } public class MixerEffects : MonoBehaviour { public AudioMixer mixer; public CameraTilt camTilt; [Space] public float DistortionTiltMultiplier = 0.001f; public float DistortionTiltMax = 0.2f; public float DistortionTiltSpeed = 1f; private float DistortionTilt; private float DistortionDefault; [Space] public float LowpassTiltMultiplier = 10f; public float LowpassTiltMax = 1000f; public float LowpassTiltSpeed = 1f; private float LowpassTilt; private float LowpassDefault; [Space] public float PitchTiltMultiplier = 0.001f; public float PitchTiltMax = 0.1f; private void Start() { } private void Update() { mixer.SetFloat("Pitch", 1f - Mathf.Clamp(Mathf.Abs(camTilt.tiltZresult * PitchTiltMultiplier), 0f, PitchTiltMax)); } } public class ConstantMusic : MonoBehaviour { public static ConstantMusic instance; private AudioSource audioSource; private bool setup; private AudioClip clip; private float volume; private void Awake() { instance = this; audioSource = ((Component)this).GetComponent<AudioSource>(); } private void Update() { if (!setup && GameDirector.instance.currentState == GameDirector.gameState.Main) { audioSource.clip = clip; audioSource.volume = volume; audioSource.Play(); setup = true; } } public void Setup() { if (!Object.op_Implicit((Object)(object)LevelGenerator.Instance.Level.ConstantMusicPreset)) { ((Component)this).gameObject.SetActive(false); return; } clip = LevelGenerator.Instance.Level.ConstantMusicPreset.clip; volume = LevelGenerator.Instance.Level.ConstantMusicPreset.volume; } } [CreateAssetMenu(fileName = "Constant Music - _____", menuName = "Level/Constant Music Preset", order = 3)] public class ConstantMusicAsset : ScriptableObject { public AudioClip clip; public float volume = 1f; } public class LevelMusic : MonoBehaviour { [Serializable] public class LevelMusicTrack { public string name; public AudioClip audioClip; [Range(0f, 1f)] public float volume = 0.8f; } public static LevelMusic instance; private PhotonView photonView; private AudioSource audioSource; private bool active; private bool activePlayed; public AnimationCurve fadeCurve; private bool interrupt; private float fadeInterrupt; private float interruptVolume; private float interruptVolumeLerp; [Space] public float cooldownTimeMin; public float cooldownTimeMax; private float cooldownTime; [Space] private List<LevelMusicTrack> levelMusicTracksRandom; private int trackIndex; private void Awake() { instance = this; photonView = ((Component)this).GetComponent<PhotonView>(); } private void Start() { cooldownTime = Random.Range(cooldownTimeMin, cooldownTimeMax); audioSource = ((Component)this).GetComponent<AudioSource>(); } public void Setup() { if (!Object.op_Implicit((Object)(object)LevelGenerator.Instance.Level.MusicPreset)) { ((Component)this).gameObject.SetActive(false); return; } levelMusicTracksRandom = new List<LevelMusicTrack>(LevelGenerator.Instance.Level.MusicPreset.tracks); levelMusicTracksRandom.Shuffle(); } private void Update() { if (GameDirector.instance.currentState != GameDirector.gameState.Main) { Interrupt(10f); } if (interrupt) { interruptVolumeLerp += fadeInterrupt * Time.deltaTime; audioSource.volume = Mathf.Lerp(interruptVolume, 0f, fadeCurve.Evaluate(interruptVolumeLerp)); if (audioSource.volume <= 0.01f) { audioSource.Stop(); interrupt = false; } } else if (active) { if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } if (!activePlayed) { audioSource.clip = levelMusicTracksRandom[trackIndex].audioClip; audioSource.volume = levelMusicTracksRandom[trackIndex].volume; audioSource.PlayScheduled(AudioSettings.dspTime + 0.5); if (SemiFunc.IsMultiplayer()) { photonView.RPC("PlayTrack", (RpcTarget)1, new object[1] { ((Object)audioSource.clip).name }); } trackIndex++; if (trackIndex >= levelMusicTracksRandom.Count) { trackIndex = 0; levelMusicTracksRandom.Shuffle(); } activePlayed = true; } else if (!audioSource.isPlaying) { active = false; } } else if (SemiFunc.IsMasterClientOrSingleplayer()) { cooldownTime -= Time.deltaTime; if (cooldownTime <= 0f) { cooldownTime = Random.Range(cooldownTimeMin, cooldownTimeMax); active = true; activePlayed = false; } } } public void Interrupt(float interruptSpeed) { if (((Behaviour)this).isActiveAndEnabled) { if (cooldownTime < cooldownTimeMin) { cooldownTime = Random.Range(cooldownTimeMin, cooldownTimeMax); } if (audioSource.isPlaying && (!interrupt || !(interruptSpeed <= fadeInterrupt))) { interrupt = true; fadeInterrupt = interruptSpeed; interruptVolume = audioSource.volume; interruptVolumeLerp = 0f; active = false; } } } [PunRPC] public void PlayTrack(string _trackName) { if (!((Behaviour)this).isActiveAndEnabled || audioSource.isPlaying) { return; } foreach (LevelMusicTrack item in levelMusicTracksRandom) { if (((Object)item.audioClip).name == _trackName) { audioSource.clip = item.audioClip; audioSource.volume = item.volume; audioSource.PlayScheduled(AudioSettings.dspTime + 0.5); } } } } [CreateAssetMenu(fileName = "Level Music - _____", menuName = "Level/Level Music Preset", order = 3)] public class LevelMusicAsset : ScriptableObject { public List<LevelMusic.LevelMusicTrack> tracks; } public class MusicEnemyCatch : MonoBehaviour { public LevelMusic LevelMusic; public AudioSource Source; public AudioClip[] Sounds; public void Play() { Source.clip = Sounds[Random.Range(0, Sounds.Length)]; Source.Play(); LevelMusic.Interrupt(10f); } } public class MusicEnemyNear : MonoBehaviour { [Serializable] public class Track { public AudioClip Clip; [Range(0f, 1f)] public float Volume = 0.5f; } public static MusicEnemyNear instance; public LevelMusic LevelMusic; public AudioSource Source; internal float Volume; [Space] public float MaxDistance = 15f; public float MinDistance = 4f; [Space] public float OnScreenDistance = 10f; [Space] public float FadeSpeed = 1f; private float LowerMultiplier = 1f; private float LowerMultiplierTarget = 1f; private float LowerTimer; private Camera Camera; public LayerMask Mask; private bool RayResult; private float RayTimer; private Track CurrentTrack; [Space] public Track[] Tracks; private void Awake() { instance = this; } private void Start() { CurrentTrack = Tracks[Random.Range(0, Tracks.Length)]; Camera = Camera.main; NewTrack(); ((MonoBehaviour)this).StartCoroutine(Logic()); } public void LowerVolume(float multiplier, float time) { LowerMultiplierTarget = multiplier; LowerTimer = time; } private IEnumerator Logic() { while (!LevelGenerator.Instance.Generated) { yield return (object)new WaitForSeconds(0.1f); } yield return (object)new WaitForSeconds(1f); RaycastHit val2 = default(RaycastHit); while (true) { if (LowerTimer > 0f) { LowerTimer -= Time.deltaTime; if (LowerTimer <= 0f) { LowerMultiplierTarget = 1f; } LowerMultiplier = Mathf.Lerp(LowerMultiplier, LowerMultiplierTarget, Time.deltaTime * 5f); } else { LowerMultiplier = Mathf.Lerp(LowerMultiplier, LowerMultiplierTarget, Time.deltaTime * 1f); } float num = 0f; if (RoundDirector.instance.allExtractionPointsCompleted) { num = 0.5f; } foreach (EnemyParent item in EnemyDirector.instance.enemiesSpawned) { float num2 = 0f; if (item.Spawned && item.Enemy.EnemyNearMusic) { if (!item.Enemy.HasPlayerDistance) { Debug.LogError((object)(((Object)item).name + " needs 'player distance' component for near music.")); continue; } if (!item.Enemy.HasOnScreen) { Debug.LogError((object)(((Object)item).name + " needs 'on screen' component for near music.")); continue; } if (!item.Enemy.HasPlayerRoom) { Debug.LogError((object)(((Object)item).name + " needs 'player room' component for near music.")); continue; } float playerDistanceLocal = item.Enemy.PlayerDistance.PlayerDistanceLocal; if (item.Enemy.CurrentState != EnemyState.Spawn) { if (item.Enemy.OnScreen.OnScreenLocal && playerDistanceLocal <= OnScreenDistance) { num2 = CurrentTrack.Volume; } else if (playerDistanceLocal <= MaxDistance) { if (RayTimer <= 0f) { RayTimer = 0.5f; Vector3 val = ((Component)Camera).transform.position - item.Enemy.CenterTransform.position; RayResult = Physics.Raycast(item.Enemy.CenterTransform.position, val, ref val2, ((Vector3)(ref val)).magnitude, LayerMask.op_Implicit(Mask)); } else { RayTimer -= Time.deltaTime; } if (!RayResult || item.Enemy.PlayerRoom.SameLocal) { playerDistanceLocal = Mathf.Clamp(playerDistanceLocal, MinDistance, MaxDistance); num2 = Mathf.Lerp(0f, CurrentTrack.Volume, 1f - (playerDistanceLocal - MinDistance) / (MaxDistance - MinDistance)); } } } } num = Mathf.Max(num, num2); } Volume = Mathf.Lerp(Volume, num * LowerMultiplier, Time.deltaTime * FadeSpeed); if (Volume > 0f) { if (!Source.isPlaying) { NewTrack(); Source.time = Random.Range(0f, Source.clip.length); Source.Play(); } Source.volume = Volume; LevelMusic.Interrupt(0.5f); } else if (Source.isPlaying) { Source.Stop(); } yield return null; } } private void NewTrack() { CurrentTrack = Tracks[Random.Range(0, Tracks.Length)]; Source.clip = CurrentTrack.Clip; } } public class MusicEnemySighting : MonoBehaviour { public AudioSource Source; public LevelMusic LevelMusic; public float Cooldown; private float CooldownTimer; public float DistanceMax; internal bool Active; public float ActiveTime; private float ActiveTimer; public AudioClip[] Sounds; private void Start() { ((MonoBehaviour)this).StartCoroutine(Logic()); } private IEnumerator Logic() { while (!LevelGenerator.Instance.Generated) { yield return (object)new WaitForSeconds(0.1f); } yield return (object)new WaitForSeconds(1f); while (true) { bool flag = false; foreach (EnemyParent item in EnemyDirector.instance.enemiesSpawned) { if (item.Spawned && item.Enemy.SightingStinger) { if (!item.Enemy.HasPlayerDistance) { Debug.LogError((object)(((Object)item).name + " needs 'player distance' component for sighting stinger.")); } else if (!item.Enemy.HasOnScreen) { Debug.LogError((object)(((Object)item).name + " needs 'on screen' component for sighting stinger.")); } else if (item.Enemy.PlayerDistance.PlayerDistanceLocal <= DistanceMax && item.Enemy.OnScreen.OnScreenLocal && item.Enemy.TeleportedTimer <= 0f && item.Enemy.CurrentState != EnemyState.Spawn) { flag = true; break; } } } if (flag) { if (!Active && CooldownTimer <= 0f) { LevelMusic.Interrupt(10f); GameDirector.instance.CameraImpact.Shake(2f, 0.1f); GameDirector.instance.CameraShake.Shake(2f, 1f); Active = true; Source.clip = Sounds[Random.Range(0, Sounds.Length)]; Source.Play(); CooldownTimer = Cooldown; ActiveTimer = ActiveTime; } } else if (CooldownTimer > 0f) { CooldownTimer -= Time.deltaTime; } if (ActiveTimer > 0f) { ActiveTimer -= Time.deltaTime; if (ActiveTimer <= 0f) { Active = false; } } yield return null; } } } public class MusicManager : MonoBehaviour { public static MusicManager Instance; public AudioMixerSnapshot MusicMixerOn; public AudioMixerSnapshot MusicMixerOff; public AudioMixerSnapshot MusicMixerScareOnly; [Space(15f)] public MusicEnemyNear MusicEnemyNear; public MusicEnemySighting MusicEnemySighting; public MusicEnemyCatch MusicEnemyCatch; private void Awake() { Instance = this; } private void Update() { if (MusicEnemySighting.Active) { MusicEnemyNear.LowerVolume(0.1f, 0.25f); } } } [CreateAssetMenu(fileName = "HingeAudio - _____", menuName = "Audio/Hinge Audio Preset", order = 1)] public class HingeAudio : ScriptableObject { [Header("Move Loop")] public bool moveLoopEnabled = true; public float moveLoopVelocityMult = 1f; public float moveLoopThreshold = 1f; public float moveLoopFadeInSpeed = 5f; public float moveLoopFadeOutSpeed = 5f; public Sound moveLoop; public Sound moveLoopEnd; [Header("One Shots")] public Sound Close; public Sound CloseHeavy; public Sound Open; public Sound OpenHeavy; public Sound HingeBreak; private void OnValidate() { if (!SemiFunc.OnValidateCheck()) { moveLoop.Type = AudioManager.AudioType.MaterialImpact; moveLoopEnd.Type = AudioManager.AudioType.MaterialImpact; } } } [CreateAssetMenu(fileName = "PhysAudio - _____", menuName = "Audio/Physics Audio Preset", order = 1)] public class PhysAudio : ScriptableObject { public Sound impactLight; public Sound impactMedium; public Sound impactHeavy; [Space(20f)] public Sound breakLight; public Sound breakMedium; public Sound breakHeavy; [Space(20f)] public Sound destroy; private void OnValidate() { if (!SemiFunc.OnValidateCheck()) { impactLight.Type = AudioManager.AudioType.MaterialImpact; impactMedium.Type = AudioManager.AudioType.MaterialImpact; impactHeavy.Type = AudioManager.AudioType.MaterialImpact; breakLight.Type = AudioManager.AudioType.MaterialImpact; breakMedium.Type = AudioManager.AudioType.MaterialImpact; breakHeavy.Type = AudioManager.AudioType.MaterialImpact; destroy.Type = AudioManager.AudioType.MaterialImpact; } } } public class ReverbDirector : MonoBehaviour { public static ReverbDirector instance; public AudioMixer mixer; [Space] public ReverbPreset currentPreset; [Space] public AnimationCurve reverbCurve; public float lerpSpeed = 1f; private float lerpAmount; private float dryLevel; private float dryLevelOld; private float dryLevelNew; private float room; private float roomOld; private float roomNew; private float roomHF; private float roomHFOld; private float roomHFNew; private float decayTime; private float decayTimeOld; private float decayTimeNew; private float decayHFRatio; private float decayHFRatioOld; private float decayHFRatioNew; private float reflections; private float reflectionsOld; private float reflectionsNew; private float reflectDelay; private float reflectDelayOld; private float reflectDelayNew; private float reverb; private float reverbOld; private float reverbNew; private float reverbDelay; private float reverbDelayOld; private float reverbDelayNew; private float diffusion; private float diffusionOld; private float diffusionNew; private float density; private float densityOld; private float densityNew; private float hfReference; private float hfReferenceOld; private float hfReferenceNew; private float roomLF; private float roomLFOld; private float roomLFNew; private float lfReference; private float lfReferenceOld; private float lfReferenceNew; private float spawnTimer; private void Awake() { instance = this; } private void Start() { Set(); } public void Set() { dryLevel = currentPreset.dryLevel; dryLevelNew = dryLevel; dryLevelOld = dryLevel; mixer.SetFloat("ReverbDryLevel", dryLevel); room = currentPreset.room; roomNew = room; roomOld = room; mixer.SetFloat("ReverbRoom", room); roomHF = currentPreset.roomHF; roomHFNew = roomHF; roomHFOld = roomHF; mixer.SetFloat("ReverbRoomHF", roomHF); decayTime = currentPreset.decayTime; decayTimeNew = decayTime; decayTimeOld = decayTime; mixer.SetFloat("ReverbDecayTime", decayTime); decayHFRatio = currentPreset.decayHFRatio; decayHFRatioNew = decayHFRatio; decayHFRatioOld = decayHFRatio; mixer.SetFloat("ReverbDecayHFRatio", decayHFRatio); reflections = currentPreset.reflections; reflectionsNew = reflections; reflectionsOld = reflections; mixer.SetFloat("ReverbReflections", reflections); reflectDelay = currentPreset.reflectDelay; reflectDelayNew = reflectDelay; reflectDelayOld = reflectDelay; mixer.SetFloat("ReverbReflectDelay", reflectDelay); reverb = currentPreset.reverb; reverbNew = reverb; reverbOld = reverb; mixer.SetFloat("ReverbReverb", reverb); reverbDelay = currentPreset.reverbDelay; reverbDelayNew = reverbDelay; reverbDelayOld = reverbDelay; mixer.SetFloat("ReverbReverbDelay", reverbDelay); diffusion = currentPreset.diffusion; diffusionNew = diffusion; diffusionOld = diffusion; mixer.SetFloat("ReverbDiffusion", diffusion); density = currentPreset.density; densityNew = density; densityOld = density; mixer.SetFloat("ReverbDensity", density); hfReference = currentPreset.hfReference; hfReferenceNew = hfReference; hfReferenceOld = hfReference; mixer.SetFloat("ReverbHFReference", hfReference); roomLF = currentPreset.roomLF; roomLFNew = roomLF; roomLFOld = roomLF; mixer.SetFloat("ReverbRoomLF", roomLF); lfReference = currentPreset.lfReference; lfReferenceNew = lfReference; lfReferenceOld = lfReference; mixer.SetFloat("ReverbLFReference", lfReference); } private void NewPreset() { dryLevelOld = dryLevel; dryLevelNew = currentPreset.dryLevel; roomOld = room; roomNew = currentPreset.room; roomHFOld = roomHF; roomHFNew = currentPreset.roomHF; decayTimeOld = decayTime; decayTimeNew = currentPreset.decayTime; decayHFRatioOld = decayHFRatio; decayHFRatioNew = currentPreset.decayHFRatio; reflectionsOld = reflections; reflectionsNew = currentPreset.reflections; reflectDelayOld = reflectDelay; reflectDelayNew = currentPreset.reflectDelay; reverbOld = reverb; reverbNew = currentPreset.reverb; reverbDelayOld = reverbDelay; reverbDelayNew = currentPreset.reverbDelay; diffusionOld = diffusion; diffusionNew = currentPreset.diffusion; densityOld = density; densityNew = currentPreset.density; hfReferenceOld = hfReference; hfReferenceNew = currentPreset.hfReference; roomLFOld = roomLF; roomLFNew = currentPreset.roomLF; lfReferenceOld = lfReference; lfReferenceNew = currentPreset.lfReference; lerpAmount = 0f; } private void Update() { if (!LevelGenerator.Instance.Generated) { return; } if (PlayerController.instance.playerAvatarScript.RoomVolumeCheck.CurrentRooms.Count > 0) { ReverbPreset reverbPreset = PlayerController.instance.playerAvatarScript.RoomVolumeCheck.CurrentRooms[0].ReverbPreset; if (Object.op_Implicit((Object)(object)reverbPreset) && (Object)(object)reverbPreset != (Object)(object)currentPreset) { currentPreset = reverbPreset; NewPreset(); } } if (lerpAmount < 1f) { lerpAmount += lerpSpeed * Time.deltaTime; float num = reverbCurve.Evaluate(lerpAmount); dryLevel = Mathf.Lerp(dryLevelOld, dryLevelNew, num); mixer.SetFloat("ReverbDryLevel", dryLevel); room = Mathf.Lerp(roomOld, roomNew, num); mixer.SetFloat("ReverbRoom", room); roomHF = Mathf.Lerp(roomHFOld, roomHFNew, num); mixer.SetFloat("ReverbRoomHF", roomHF); decayTime = Mathf.Lerp(decayTimeOld, decayTimeNew, num); mixer.SetFloat("ReverbDecayTime", decayTime); decayHFRatio = Mathf.Lerp(decayHFRatioOld, decayHFRatioNew, num); mixer.SetFloat("ReverbDecayHFRatio", decayHFRatio); reflections = Mathf.Lerp(reflectionsOld, reflectionsNew, num); mixer.SetFloat("ReverbReflections", reflections); reflectDelay = Mathf.Lerp(reflectDelayOld, reflectDelayNew, num); mixer.SetFloat("ReverbReflectDelay", reflectDelay); reverb = Mathf.Lerp(reverbOld, reverbNew, num); mixer.SetFloat("ReverbReverb", reverb); reverbDelay = Mathf.Lerp(reverbDelayOld, reverbDelayNew, num); mixer.SetFloat("ReverbReverbDelay", reverbDelay); diffusion = Mathf.Lerp(diffusionOld, diffusionNew, num); mixer.SetFloat("ReverbDiffusion", diffusion); density = Mathf.Lerp(densityOld, densityNew, num); mixer.SetFloat("ReverbDensity", density); hfReference = Mathf.Lerp(hfReferenceOld, hfReferenceNew, num); mixer.SetFloat("ReverbHFReference", hfReference); roomLF = Mathf.Lerp(roomLFOld, roomLFNew, num); mixer.SetFloat("ReverbRoomLF", roomLF); lfReference = Mathf.Lerp(lfReferenceOld, lfReferenceNew, num); mixer.SetFloat("ReverbLFReference", lfReference); } } } [CreateAssetMenu(fileName = "Reverb - _____", menuName = "Audio/Reverb Preset", order = 0)] public class ReverbPreset : ScriptableObject { [Range(-10000f, 0f)] public float dryLevel; [Range(-10000f, 0f)] public float room = -686f; [Range(-10000f, 0f)] public float roomHF = -454f; [Range(0.1f, 20f)] public float decayTime = 1f; [Range(0.1f, 2f)] public float decayHFRatio = 0.83f; [Range(-10000f, 1000f)] public float reflections = -1646f; [Range(0f, 0.3f)] public float reflectDelay; [Range(-10000f, 2000f)] public float reverb = 53f; [Range(0f, 0.1f)] public float reverbDelay; [Range(0f, 100f)] public float diffusion = 100f; [Range(0f, 100f)] public float density = 100f; [Range(20f, 20000f)] public float hfReference = 5000f; [Range(-10000f, 0f)] public float roomLF = -4659f; [Range(20f, 1000f)] public float lfReference = 250f; private void OnValidate() { if (!SemiFunc.OnValidateCheck() && Application.isPlaying) { ReverbDirector.instance.Set(); } } } [CreateAssetMenu(fileName = "Room Ambience - _____", menuName = "Audio/Room Ambience", order = 0)] public class RoomAmbience : ScriptableObject { [Range(0f, 2f)] public float volume = 1f; } [Serializable] public class Sound { public AudioSource Source; public AudioClip[] Sounds; private AudioLowPassLogic LowPassLogic; private bool HasLowPassLogic; public AudioManager.AudioType Type; [Range(0f, 1f)] public float Volume = 0.5f; [Range(0f, 1f)] public float VolumeRandom = 0.1f; [Range(0f, 5f)] public float Pitch = 1f; [Range(0f, 2f)] public float PitchRandom = 0.1f; [Range(0f, 1f)] public float SpatialBlend = 1f; [Range(0f, 5f)] public float Doppler = 1f; [Range(0f, 1f)] public float ReverbMix = 1f; [Range(0f, 5f)] public float FalloffMultiplier = 1f; [Space] [Range(0f, 1f)] public float OffscreenVolume = 1f; [Range(0f, 1f)] public float OffscreenFalloff = 1f; [Space] public List<Collider> LowPassIgnoreColliders = new List<Collider>(); private AudioClip LoopClip; internal float LoopVolume; internal float LoopVolumeCurrent; internal float LoopVolumeFinal; internal float LoopPitch; internal float LoopFalloff; internal float LoopFalloffFinal; private float LoopOffScreenTime = 0.25f; private float LoopOffScreenTimer; private bool LoopOffScreen; private float LoopOffScreenVolume; private float LoopOffScreenFalloff; internal float StartTimeOverride = 999999f; private bool AudioInfoFetched; public AudioSource Play(Vector3 position, float volumeMultiplier = 1f, float falloffMultiplier = 1f, float offscreenVolumeMultiplier = 1f, float offscreenFalloffMultiplier = 1f) { //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) if (Sounds.Length == 0) { return null; } AudioClip val = Sounds[Random.Range(0, Sounds.Length)]; float num = Pitch + Random.Range(0f - PitchRandom, PitchRandom); AudioSource val2 = Source; if (!Object.op_Implicit((Object)(object)val2)) { GameObject val3 = AudioManager.instance.AudioDefault; switch (Type) { case AudioManager.AudioType.HighFalloff: val3 = AudioManager.instance.AudioHighFalloff; break; case AudioManager.AudioType.Footstep: val3 = AudioManager.instance.AudioFootstep; break; case AudioManager.AudioType.MaterialImpact: val3 = AudioManager.instance.AudioMaterialImpact; break; case AudioManager.AudioType.Cutscene: val3 = AudioManager.instance.AudioCutscene; break; case AudioManager.AudioType.AmbienceBreaker: val3 = AudioManager.instance.AudioAmbienceBreaker; break; case AudioManager.AudioType.LowFalloff: val3 = AudioManager.instance.AudioLowFalloff; break; case AudioManager.AudioType.Global: val3 = AudioManager.instance.AudioGlobal; break; case AudioManager.AudioType.HigherFalloff: val3 = AudioManager.instance.AudioHigherFalloff; break; case AudioManager.AudioType.Attack: val3 = AudioManager.instance.AudioAttack; break; case AudioManager.AudioType.Persistent: val3 = AudioManager.instance.AudioPersistent; break; } GameObject val4 = Object.Instantiate<GameObject>(val3, position, Quaternion.identity, AudioManager.instance.SoundsParent); ((Object)val4.gameObject).name = ((Object)val).name; val2 = val4.GetComponent<AudioSource>(); if ((Object)(object)val3 != (Object)(object)AudioManager.instance.AudioPersistent) { Object.Destroy((Object)(object)val4, val.length / num); } } else if (!((Behaviour)val2).enabled) { return null; } AudioSource obj = val2; obj.minDistance *= FalloffMultiplier; AudioSource obj2 = val2; obj2.minDistance *= falloffMultiplier; AudioSource obj3 = val2; obj3.maxDistance *= FalloffMultiplier; AudioSource obj4 = val2; obj4.maxDistance *= falloffMultiplier; val2.clip = Sounds[Random.Range(0, Sounds.Length)]; val2.volume = (Volume + Random.Range(0f - VolumeRandom, VolumeRandom)) * volumeMultiplier; if (SpatialBlend > 0f && (OffscreenVolume * offscreenVolumeMultiplier < 1f || OffscreenFalloff * offscreenFalloffMultiplier < 1f) && !SemiFunc.OnScreen(((Component)val2).transform.position, 0.1f, 0.1f)) { AudioSource obj5 = val2; obj5.volume *= OffscreenVolume * offscreenVolumeMultiplier; AudioSource obj6 = val2; obj6.minDistance *= OffscreenFalloff * offscreenFalloffMultiplier; AudioSource obj7 = val2; obj7.maxDistance *= OffscreenFalloff * offscreenFalloffMultiplier; } val2.spatialBlend = SpatialBlend; val2.reverbZoneMix = ReverbMix; val2.dopplerLevel = Doppler; val2.pitch = num; val2.loop = false; if (SpatialBlend > 0f) { StartLowPass(val2); } val2.Play(); return val2; } public void Stop() { Source.Stop(); } private void StartLowPass(AudioSource source) { LowPassLogic = ((Component)source).GetComponent<AudioLowPassLogic>(); if (Object.op_Implicit((Object)(object)LowPassLogic)) { if (LowPassIgnoreColliders.Count > 0) { LowPassLogic.LowPassIgnoreColliders.AddRange(LowPassIgnoreColliders); } LowPassLogic.Setup(); HasLowPassLogic = true; } } public void PlayLoop(bool playing, float fadeInSpeed, float fadeOutSpeed, float pitchMultiplier = 1f) { if (!AudioInfoFetched) { LoopClip = Sounds[Random.Range(0, Sounds.Length)]; Source.clip = LoopClip; } if (playing) { if (!Source.isPlaying) { LoopVolume = Volume + Random.Range(0f - VolumeRandom, VolumeRandom); LoopPitch = Pitch + Random.Range(0f - PitchRandom, PitchRandom); LoopVolumeCurrent = 0f; LoopVolumeFinal = LoopVolumeCurrent; Source.volume = LoopVolumeCurrent; Source.pitch = LoopPitch * pitchMultiplier; Source.spatialBlend = SpatialBlend; Source.reverbZoneMix = ReverbMix; Source.dopplerLevel = Doppler; AudioSource source = Source; source.minDistance *= FalloffMultiplier; AudioSource source2 = Source; source2.maxDistance *= FalloffMultiplier; LoopFalloff = Source.maxDistance; Source.time = Random.Range(0f, Source.clip.length); if (StartTimeOverride != 999999f) { Source.time = StartTimeOverride; } Source.loop = true; StartLowPass(Source); Source.Play(); } else { LoopVolumeCurrent += fadeInSpeed * Time.deltaTime; LoopVolumeCurrent = Mathf.Clamp(LoopVolumeCurrent, 0f, LoopVolume); LoopOffScreenLogic(); Source.pitch = LoopPitch * pitchMultiplier; if (HasLowPassLogic) { LowPassLogic.Volume = LoopVolumeFinal; } else { Source.volume = LoopVolumeFinal; } } } else if (Source.isPlaying) { LoopVolumeCurrent -= fadeOutSpeed * Time.deltaTime; LoopVolumeCurrent = Mathf.Clamp(LoopVolumeCurrent, 0f, LoopVolume); LoopOffScreenLogic(); Source.pitch = LoopPitch * pitchMultiplier; if (HasLowPassLogic) { LowPassLogic.Volume = LoopVolumeFinal; } else { Source.volume = LoopVolumeFinal; } if (LoopVolumeFinal <= 0f) { Source.Stop(); } } } private void LoopOffScreenLogic() { //IL_005e: Unknown result type (might be due to invalid IL or missing references) LoopVolumeFinal = LoopVolumeCurrent; if (!(SpatialBlend > 0f) || (!(OffscreenVolume < 1f) && !(OffscreenFalloff < 1f))) { return; } if (LoopOffScreenTimer <= 0f) { LoopOffScreenTimer = LoopOffScreenTime; LoopOffScreen = !SemiFunc.OnScreen(((Component)Source).transform.position, 0.1f, 0.1f); } else { LoopOffScreenTimer -= Time.deltaTime; } if (OffscreenVolume < 1f) { if (LoopOffScreen) { LoopOffScreenVolume = Mathf.Lerp(LoopOffScreenVolume, OffscreenVolume, 15f * Time.deltaTime); } else { LoopOffScreenVolume = Mathf.Lerp(LoopOffScreenVolume, 1f, 15f * Time.deltaTime); } LoopVolumeFinal *= LoopOffScreenVolume; } if (OffscreenFalloff < 1f) { if (LoopOffScreen) { LoopFalloffFinal = Mathf.Lerp(LoopFalloffFinal, LoopFalloff * OffscreenFalloff, 15f * Time.deltaTime); } else { LoopFalloffFinal = Mathf.Lerp(LoopFalloffFinal, LoopFalloff, 15f * Time.deltaTime); } if (HasLowPassLogic) { LowPassLogic.Falloff = LoopFalloffFinal; } else { Source.maxDistance = LoopFalloffFinal; } } } public static void CopySound(Sound from, Sound to) { to.Source = from.Source; to.Sounds = from.Sounds; to.Type = from.Type; to.Volume = from.Volume; to.VolumeRandom = from.VolumeRandom; to.Pitch = from.Pitch; to.PitchRandom = from.PitchRandom; to.SpatialBlend = from.SpatialBlend; to.ReverbMix = from.ReverbMix; to.Doppler = from.Doppler; } } public class CameraAim : MonoBehaviour { public static CameraAim Instance; public CameraTarget camController; public Transform playerTransform; public float AimSpeedMouse = 1f; public float AimSpeedGamepad = 1f; private float aimVertical; private float aimHorizontal; internal float aimSmoothOriginal = 2f; private Quaternion playerAim = Quaternion.identity; private Vector3 AimTargetPosition = Vector3.zero; public AnimationCurve AimTargetCurve; [Space] public bool AimTargetActive; private float AimTargetTimer; private float AimTargetSpeed; private float AimTargetLerp; private GameObject AimTargetObject; private int AimTargetPriority = 999; private bool AimTargetSoftActive; private float AimTargetSoftTimer; private float AimTargetSoftStrengthCurrent; private float AimTargetSoftStrength; private float AimTargetSoftStrengthNoAim; private Vector3 AimTargetSoftPosition; private GameObject AimTargetSoftObject; private int AimTargetSoftPriority = 999; private float overrideAimStopTimer; internal bool overrideAimStop; private float PlayerAimingTimer; private float overrideAimSmooth; private float overrideAimSmoothTimer; private void Awake() { Instance = this; } public void AimTargetSet(Vector3 position, float time, float speed, GameObject obj, int priority) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) if (priority <= AimTargetPriority && (!((Object)(object)obj != (Object)(object)AimTargetObject) || AimTargetLerp == 0f)) { AimTargetActive = true; AimTargetObject = obj; AimTargetPosition = position; AimTargetTimer = time; AimTargetSpeed = speed; AimTargetPriority = priority; } } public void AimTargetSoftSet(Vector3 position, float time, float strength, float strengthNoAim, GameObject obj, int priority) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (priority <= AimTargetSoftPriority && (!Object.op_Implicit((Object)(object)AimTargetSoftObject) || !((Object)(object)obj != (Object)(object)AimTargetSoftObject))) { if ((Object)(object)obj != (Object)(object)AimTargetSoftObject) { PlayerAimingTimer = 0f; } AimTargetSoftPosition = position; AimTargetSoftTimer = time; AimTargetSoftStrength = strength; AimTargetSoftStrengthNoAim = strengthNoAim; AimTargetSoftObject = obj; AimTargetSoftPriority = priority; } } public void CameraAimSpawn(float _rotation) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) aimHorizontal = _rotation; playerAim = Quaternion.Euler(aimVertical, aimHorizontal, 0f); ((Component)this).transform.localRotation = playerAim; } public void OverrideAimStop() { overrideAimStopTimer = 0.2f; } private void OverrideAimStopTick() { if (overrideAimStopTimer > 0f) { overrideAimStop = true; overrideAimStopTimer -= Time.deltaTime; } else { overrideAimStop = false; } } private void Update() { //IL_0454: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_0413: Unknown result type (might be due to invalid IL or missing references) //IL_0418: Unknown result type (might be due to invalid IL or missing references) //IL_0420: Unknown result type (might be due to invalid IL or missing references) //IL_042b: Unknown result type (might be due to invalid IL or missing references) //IL_036e: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_037e: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_0388: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_038b: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) AimSpeedMouse = Mathf.Lerp(0.2f, 4f, GameplayManager.instance.aimSensitivity / 100f); if (GameDirector.instance.currentState >= GameDirector.gameState.Main) { if (!GameDirector.instance.DisableInput && AimTargetTimer <= 0f && !overrideAimStop) { InputManager.instance.mouseSensitivity = 0.05f; Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(SemiFunc.InputMouseX(), SemiFunc.InputMouseY()); Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(Input.GetAxis("Gamepad Aim X"), Input.GetAxis("Gamepad Aim Y")); val2 = Vector2.zero; if (AimTargetSoftTimer > 0f) { val = ((!(((Vector2)(ref val)).magnitude > 1f)) ? Vector2.zero : ((Vector2)(ref val)).normalized); val2 = ((!(((Vector2)(ref val2)).magnitude > 0.1f)) ? Vector2.zero : ((Vector2)(ref val2)).normalized); } else { val *= AimSpeedMouse; val2 *= AimSpeedGamepad * Time.deltaTime; } aimHorizontal += ((Vector2)(ref val))[0]; aimHorizontal += ((Vector2)(ref val2))[0]; if (aimHorizontal > 360f) { aimHorizontal -= 360f; } if (aimHorizontal < -360f) { aimHorizontal += 360f; } aimVertical += 0f - ((Vector2)(ref val))[1]; aimVertical += 0f - ((Vector2)(ref val2))[1]; aimVertical = Mathf.Clamp(aimVertical, -70f, 80f); playerAim = Quaternion.Euler(aimVertical, aimHorizontal, 0f); if (GameplayManager.instance.cameraSmoothing != 0f) { playerAim = Quaternion.RotateTowards(((Component)this).transform.localRotation, playerAim, 10000f * Time.deltaTime); } if (((Vector2)(ref val2)).magnitude > 0f || ((Vector2)(ref val)).magnitude > 0f) { PlayerAimingTimer = 0.1f; } } if (PlayerAimingTimer > 0f) { PlayerAimingTimer -= Time.deltaTime; } if (AimTargetTimer > 0f) { AimTargetTimer -= Time.deltaTime; AimTargetLerp += Time.deltaTime * AimTargetSpeed; AimTargetLerp = Mathf.Clamp01(AimTargetLerp); } else if (AimTargetLerp > 0f) { ResetPlayerAim(((Component)this).transform.localRotation); AimTargetLerp = 0f; AimTargetPriority = 999; AimTargetActive = false; } Quaternion val3 = Quaternion.LerpUnclamped(playerAim, Quaternion.LookRotation(AimTargetPosition - ((Component)this).transform.position), AimTargetCurve.Evaluate(AimTargetLerp)); if (AimTargetSoftTimer > 0f && AimTargetTimer <= 0f) { float num = AimTargetSoftStrength; if (PlayerAimingTimer <= 0f) { num = AimTargetSoftStrengthNoAim; } AimTargetSoftStrengthCurrent = Mathf.Lerp(AimTargetSoftStrengthCurrent, num, 10f * Time.deltaTime); Quaternion val4 = Quaternion.LookRotation(AimTargetSoftPosition - ((Component)this).transform.position); val3 = Quaternion.Lerp(val3, val4, num * Time.deltaTime); AimTargetSoftTimer -= Time.deltaTime; if (AimTargetSoftTimer <= 0f) { AimTargetSoftObject = null; AimTargetSoftPriority = 999; } } float num2 = (aimSmoothOriginal = Mathf.Lerp(50f, 8f, GameplayManager.instance.cameraSmoothing / 100f)); if (overrideAimSmoothTimer > 0f) { num2 = overrideAimSmooth; } ((Component)this).transform.localRotation = Quaternion.Lerp(((Component)this).transform.localRotation, val3, num2 * Time.deltaTime); ResetPlayerAim(val3); } if (SemiFunc.MenuLevel() && Object.op_Implicit((Object)(object)CameraNoPlayerTarget.instance)) { ((Component)this).transform.localRotation = ((Component)CameraNoPlayerTarget.instance).transform.rotation; } if (overrideAimSmoothTimer > 0f) { overrideAimSmoothTimer -= Time.deltaTime; } OverrideAimStopTick(); } private void ResetPlayerAim(Quaternion _rotation) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) if (((Quaternion)(ref _rotation)).eulerAngles.x > 180f) { aimVertical = ((Quaternion)(ref _rotation)).eulerAngles.x - 360f; } else { aimVertical = ((Quaternion)(ref _rotation)).eulerAngles.x; } aimHorizontal = ((Quaternion)(ref _rotation)).eulerAngles.y; playerAim = _rotation; } public void OverrideAimSmooth(float _smooth, float _time) { overrideAimSmooth = _smooth; overrideAimSmoothTimer = _time; } } public class CameraAimOffset : MonoBehaviour { public static CameraAimOffset Instance; private bool Animating; private bool Active; private float ActiveTimer; public AnimationCurve IntroCurve; public float IntroSpeed = 1f; public AnimationCurve OutroCurve; public float OutroSpeed = 1f; private float LerpAmount; private Vector3 PositionStart; private Vector3 RotationStart; private Vector3 PositionEnd; private Vector3 RotationEnd; private float IntroPauseTimer = 0.1f; private void Awake() { Instance = this; } private void Start() { ((MonoBehaviour)this).StartCoroutine(LateStart()); } private IEnumerator LateStart() { yield return (object)new WaitForSeconds(0.5f); if (!Object.op_Implicit((Object)(object)CameraNoPlayerTarget.instance)) { Set(Vector3.zero, new Vector3(45f, 0f, 0f), 0f); Active = false; LerpAmount = 0.25f; } Active = false; PositionStart = PositionEnd; RotationStart = RotationEnd; PositionEnd = Vector3.zero; RotationEnd = Vector3.zero; } public void Set(Vector3 position, Vector3 rotation, float time) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) if (!Active || position != PositionEnd || rotation != RotationEnd) { PositionStart = ((Component)this).transform.localPosition; RotationStart = ((Component)this).transform.localEulerAngles; PositionEnd = position; RotationEnd = rotation; Active = true; LerpAmount = 0f; } ActiveTimer = time; if (!Animating) { Animating = true; ((MonoBehaviour)this).StartCoroutine(Animate()); } } private IEnumerator Animate() { while (GameDirector.instance.currentState != GameDirector.gameState.Main || IntroPauseTimer > 0f) { IntroPauseTimer -= Time.deltaTime; yield return null; } if (Object.op_Implicit((Object)(object)CameraNoPlayerTarget.instance)) { yield break; } while (Animating) { if (Active) { ((Component)this).transform.localPosition = Vector3.Lerp(PositionStart, PositionEnd, IntroCurve.Evaluate(LerpAmount)); ((Component)this).transform.localRotation = Quaternion.Lerp(Quaternion.Euler(RotationStart), Quaternion.Euler(RotationEnd), IntroCurve.Evaluate(LerpAmount)); LerpAmount += IntroSpeed * Time.deltaTime; LerpAmount = Mathf.Clamp01(LerpAmount); if (ActiveTimer > 0f) { ActiveTimer -= Time.deltaTime; } else { PositionStart = ((Component)this).transform.localPosition; CameraAimOffset cameraAimOffset = this; Quaternion localRotation = ((Component)this).transform.localRotation; cameraAimOffset.RotationStart = ((Quaternion)(ref localRotation)).eulerAngles; PositionEnd = Vector3.zero; RotationEnd = Vector3.zero; Active = false; LerpAmount = 0f; } } else { ((Component)this).transform.localPosition = Vector3.Lerp(PositionStart, PositionEnd, OutroCurve.Evaluate(LerpAmount)); ((Component)this).transform.localRotation = Quaternion.Lerp(Quaternion.Euler(RotationStart), Quaternion.Euler(RotationEnd), OutroCurve.Evaluate(LerpAmount)); LerpAmount += OutroSpeed * Time.deltaTime; LerpAmount = Mathf.Clamp01(LerpAmount); if (LerpAmount >= 1f) { Animating = false; } } yield return null; } } } public class CameraBob : MonoBehaviour { public static CameraBob Instance; public CameraTarget camController; public PlayerController playerController; public AudioPlay footstepAudio; [Header("Bob Up")] public AnimationCurve bobUpCurve; public float bobUpLerpSpeed; public float bobUpLerpStrength; private float bobUpLerpStrengthCurrent; private float bobUpLerpAmount; public float bobUpActiveLerpSpeedIn = 1f; public float bobUpActiveLerpSpeedOut = 1f; private float bobUpActiveLerp; public AnimationCurve bobUpActiveCurve; [Header("Bob Side")] public AnimationCurve bobSideCurve; public float bobSideLerpSpeed; public float bobSideLerpStrength; private float bobSideLerpStrengthCurrent; private float bobSideLerpAmount; private bool bobSideRev; public float bobSideActiveLerpSpeedIn = 1f; public float bobSideActiveLerpSpeedOut = 1f; private float bobSideActiveLerp; public AnimationCurve bobSideActiveCurve; [Header("Other")] public float SprintSpeedMultiplier = 1f; public float CrouchSpeedMultiplier = 1f; public float CrouchAmountMultiplier = 1f; private float Multiplier; private float MultiplierTarget; private float MultiplierTimer; internal Vector3 positionResult; internal Quaternion rotationResult; private void Awake() { Instance = this; } private void Start() { bobUpLerpStrengthCurrent = bobUpLerpStrength; bobSideLerpStrengthCurrent = bobSideLerpStrength; } public void SetMultiplier(float multiplier, float time) { MultiplierTarget = multiplier; MultiplierTimer = time; } private void Update() { //IL_0414: Unknown result type (might be due to invalid IL or missing references) //IL_0419: Unknown result type (might be due to invalid IL or missing references) //IL_0425: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_0431: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0442: Unknown result type (might be due to invalid IL or missing references) //IL_0447: Unknown result type (might be due to invalid IL or missing references) //IL_0452: Unknown result type (might be due to invalid IL or missing references) //IL_0458: Unknown result type (might be due to invalid IL or missing references) //IL_0467: Unknown result type (might be due to invalid IL or missing references) //IL_0477: Unknown result type (might be due to invalid IL or missing references) //IL_047d: Unknown result type (might be due to invalid IL or missing references) //IL_048c: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_03f0: Unknown result type (might be due to invalid IL or missing references) //IL_03f5: Unknown result type (might be due to invalid IL or missing references) float overrideSpeedMultiplier = PlayerController.instance.overrideSpeedMultiplier; float num = Time.deltaTime * overrideSpeedMultiplier; if (MultiplierTimer > 0f) { MultiplierTimer -= 1f * num; } else { MultiplierTarget = 1f; } Multiplier = Mathf.Lerp(Multiplier, MultiplierTarget, 5f * num); if (GameDirector.instance.currentState == GameDirector.gameState.Main && !PlayerController.instance.playerAvatarScript.isDisabled) { float num2 = 1f; float num3 = 1f; if (playerController.sprinting) { float num4 = SprintSpeedMultiplier + (float)StatsManager.instance.playerUpgradeSpeed[playerController.playerAvatarScript.steamID] * 0.1f; num2 = Mathf.Lerp(1f, num4, playerController.SprintSpeedLerp); } else if (playerController.Crouching) { num2 = CrouchSpeedMultiplier; num3 = CrouchAmountMultiplier; } bobUpLerpStrengthCurrent = Mathf.Lerp(bobUpLerpStrengthCurrent, bobUpLerpStrength * num3, 5f * num); float num5 = Mathf.LerpUnclamped(0f, bobUpLerpStrengthCurrent, bobUpCurve.Evaluate(bobUpLerpAmount)); bobUpLerpAmount += bobUpLerpSpeed * bobUpActiveLerp * num2 * num; if (bobUpLerpAmount > 1f) { if (playerController.CollisionController.Grounded && !CameraJump.instance.jumpActive) { if (playerController.sprinting) { playerController.playerAvatarScript.Footstep(Materials.SoundType.Heavy); } else if (bobUpActiveLerp > 0.75f && !playerController.Crouching) { playerController.playerAvatarScript.Footstep(Materials.SoundType.Medium); } else { playerController.playerAvatarScript.Footstep(Materials.SoundType.Light); } } bobUpLerpAmount = 0f; } if (playerController.moving && !camController.targetActive && playerController.CollisionController.Grounded) { bobUpActiveLerp = Mathf.Clamp01(bobUpActiveLerp + bobUpActiveLerpSpeedIn * num); } else { bobUpActiveLerp = Mathf.Clamp01(bobUpActiveLerp - bobUpActiveLerpSpeedOut * num); } bobSideLerpStrengthCurrent = Mathf.Lerp(bobSideLerpStrengthCurrent, bobSideLerpStrength * num3, 5f * num); float num6 = Mathf.LerpUnclamped(0f - bobSideLerpStrengthCurrent, bobSideLerpStrengthCurrent, bobSideCurve.Evaluate(bobSideLerpAmount)); if (bobSideRev) { bobSideLerpAmount += bobSideLerpSpeed * bobSideActiveLerp * num2 * num; if (bobSideLerpAmount > 1f) { bobSideRev = false; } } else { bobSideLerpAmount -= bobSideLerpSpeed * bobSideActiveLerp * num2 * num; if (bobSideLerpAmount < 0f) { bobSideRev = true; } } if (playerController.moving && !camController.targetActive) { bobSideActiveLerp = Mathf.Clamp01(bobSideActiveLerp + bobSideActiveLerpSpeedIn * num); } else { bobSideActiveLerp = Mathf.Clamp01(bobSideActiveLerp - bobSideActiveLerpSpeedOut * num); } positionResult = new Vector3(0f, Mathf.LerpUnclamped(0f, num5, bobUpActiveCurve.Evaluate(bobUpActiveLerp)) * Multiplier, 0f); rotationResult = Quaternion.Euler(0f, Mathf.LerpUnclamped(0f, num6 * 10f, bobSideActiveCurve.Evaluate(bobSideActiveLerp)) * Multiplier, Mathf.LerpUnclamped(0f, num6 * 5f, bobSideActiveCurve.Evaluate(bobSideActiveLerp)) * Multiplier); } else { bobSideActiveLerp = 0f; bobUpActiveLerp = 0f; positionResult = Vector3.Lerp(positionResult, Vector3.zero, 5f * num); rotationResult = Quaternion.Slerp(rotationResult, Quaternion.identity, 5f * num); } ((Component)this).transform.localPosition = Vector3.Lerp(Vector3.zero, positionResult, GameplayManager.instance.cameraAnimation); ((Component)this).transform.localRotation = Quaternion.Slerp(Quaternion.identity, rotationResult, GameplayManager.instance.cameraAnimation); } } public class CameraFreeze : MonoBehaviour { public static CameraFreeze instance; public List<Camera> cameras = new List<Camera>(); private float timer; private void Awake() { instance = this; } private void Update() { if (!(timer > 0f)) { return; } timer -= Time.deltaTime; if (!(timer <= 0f)) { return; } foreach (Camera camera in cameras) { ((Behaviour)camera).enabled = true; } } public static void Freeze(float _time) { if (_time <= 0f) { foreach (Camera camera in instance.cameras) { ((Behaviour)camera).enabled = true; } instance.timer = _time; return; } if (instance.timer <= 0f) { foreach (Camera camera2 in instance.cameras) { ((Behaviour)camera2).enabled = false; } } instance.timer = _time; } public static bool IsFrozen() { return instance.timer > 0f; } } public class CameraJump : MonoBehaviour { public static CameraJump instance; internal bool jumpActive; public AnimationCurve jumpCurve; public float jumpSpeed = 1f; private float jumpLerp; public Vector3 jumpPosition; public Vector3 jumpRotation; [Space] private bool landActive; public AnimationCurve landCurve; public float landSpeed = 1f; private float landLerp; public Vector3 landPosition; public Vector3 landRotation; private void Awake() { instance = this; } public void Jump() { GameDirector.instance.CameraImpact.Shake(1f, 0.05f); GameDirector.instance.CameraShake.Shake(2f, 0.1f); jumpActive = true; jumpLerp = 0f; } public void Land() { if (!landActive) { GameDirector.instance.CameraImpact.Shake(1f, 0.05f); GameDirector.instance.CameraShake.Shake(2f, 0.1f); landActive = true; landLerp = 0f; } } private void Update() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.zero; Vector3 val2 = Vector3.zero; if (jumpActive) { if (jumpLerp >= 1f) { jumpActive = false; jumpLerp = 0f; } else { val += Vector3.LerpUnclamped(Vector3.zero, jumpPosition, jumpCurve.Evaluate(jumpLerp)); val2 += Vector3.LerpUnclamped(Vector3.zero, jumpRotation, jumpCurve.Evaluate(jumpLerp)); jumpLerp += jumpSpeed * Time.deltaTime; } } if (landActive) { if (landLerp >= 1f) { landActive = false; landLerp = 0f; } else { val += Vector3.LerpUnclamped(Vector3.zero, landPosition, landCurve.Evaluate(landLerp)); val2 += Vector3.LerpUnclamped(Vector3.zero, landRotation, landCurve.Evaluate(landLerp)); landLerp += landSpeed * Time.deltaTime; } } val *= GameplayManager.instance.cameraAnimation; val2 *= GameplayManager.instance.cameraAnimation; ((Component)this).transform.localPosition = Vector3.Lerp(((Component)this).transform.localPosition, val, 30f * Time.deltaTime); Quaternion localRotation = ((Component)this).transform.localRotation; ((Component)this).transform.localEulerAngles = val2; Quaternion localRotation2 = ((Component)this).transform.localRotation; ((Component)this).transform.localRotation = localRotation; ((Component)this).transform.localRotation = Quaternion.Lerp(((Component)this).transform.localRotation, localRotation2, 30f * Time.deltaTime); } } public class CameraLobbyMenu : CameraNoPlayerTarget { protected override void Awake() { base.Awake(); CameraNoise.Instance.AnimNoise.noiseStrengthDefault = 0.3f; CameraNoise.Instance.AnimNoise.noiseSpeedDefault = 4f; } } public class CameraMainMenu : CameraNoPlayerTarget { public AnimationCurve introCurve; private float introLerp; protected override void Awake() { base.Awake(); CameraNoise.Instance.AnimNoise.noiseStrengthDefault = 0.3f; CameraNoise.Instance.AnimNoise.noiseSpeedDefault = 4f; } protected override void Update() { //IL_0068: Unknown result type (might be due to invalid IL or missing references) base.Update(); if (GameDirector.instance.currentState == GameDirector.gameState.Main && introLerp < 1f) { introLerp += 0.25f * Time.deltaTime; ((Component)this).transform.localEulerAngles = new Vector3(Mathf.LerpUnclamped(0f, -45f, introCurve.Evaluate(introLerp)), 0f, 0f); } } } public class CameraNoise : MonoBehaviour { public static CameraNoise Instance; public float StrengthDefault = 0.2f; public AnimNoise AnimNoise; private float Strength = 1f; private float OverrideStrength = 1f; private float OverrideTimer; private void Awake() { Instance = this; Strength = StrengthDefault; } private void Update() { if (OverrideTimer > 0f) { OverrideTimer -= Time.deltaTime; if (OverrideTimer <= 0f) { OverrideTimer = 0f; } else { Strength = Mathf.Lerp(Strength, OverrideStrength * GameplayManager.instance.cameraNoise, 5f * Time.deltaTime); } AnimNoise.noiseStrengthDefault = Strength; } else if (Mathf.Abs(Strength - StrengthDefault * GameplayManager.instance.cameraNoise) > 0.001f) { Strength = Mathf.Lerp(Strength, StrengthDefault * GameplayManager.instance.cameraNoise, 5f * Time.deltaTime); } AnimNoise.noiseStrengthDefault = Strength; } public void Override(float strength, float time) { OverrideStrength = strength; OverrideTimer = time; } } public class CameraNoPlayerTarget : MonoBehaviour { public static CameraNoPlayerTarget instance; internal Camera cam; protected virtual void Awake() { instance = this; cam = ((Component)this).GetComponent<Camera>(); ((Behaviour)cam).enabled = false; } protected virtual void Update() { SemiFunc.UIHideAim(); SemiFunc.UIHideCurrency(); SemiFunc.UIHideEnergy(); SemiFunc.UIHideGoal(); SemiFunc.UIHideHaul(); SemiFunc.UIHideHealth(); SemiFunc.UIHideInventory(); SemiFunc.UIHideShopCost(); } } public class CameraPosition : MonoBehaviour { public static CameraPosition instance; public Transform playerTransform; public Vector3 playerOffset; public CameraTarget camController; public float positionSmooth = 2f; private float tumbleSetTimer; private void Awake() { instance = this; } private void Update() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) float num = positionSmooth; if (tumbleSetTimer > 0f) { num *= 0.5f; tumbleSetTimer -= Time.deltaTime; } Vector3 val = playerTransform.localPosition + playerOffset; if (SemiFunc.MenuLevel() && Object.op_Implicit((Object)(object)CameraNoPlayerTarget.instance)) { val = ((Component)CameraNoPlayerTarget.instance).transform.position; } ((Component)this).transform.localPosition = Vector3.Slerp(((Component)this).transform.localPosition, val, num * Time.deltaTime); ((Component)this).transform.localRotation = Quaternion.Slerp(((Component)this).transform.localRotation, Quaternion.identity, num * Time.deltaTime); if (SemiFunc.MenuLevel()) { ((Component)this).transform.localPosition = val; } } public void TumbleSet() { tumbleSetTimer = 0.5f; } } public class CameraShake : MonoBehaviour { public AnimationCurve Curve; [Space] public bool InstantShake; [Space] public float Strength; public float StrengthMax = 1f; public float StrengthLoss = 1f; public float StrengthLossDelay; [Space] public float Speed = 1f; [Space] public float RotationMultiplier = 1f; public float PositionMultiplier = 1f; private float RotXLerp = 1f; private float RotXNew; private float RotXOld; private float RotXSpeed; private float RotYLerp = 1f; private float RotYNew; private float RotYOld; private float RotYSpeed; private float RotZLerp = 1f; private float RotZNew; private float RotZOld; private float RotZSpeed; private float PosXLerp = 1f; private float PosXNew; private float PosXOld; private float PosXSpeed; private float PosYLerp = 1f; private float PosYNew; private float PosYOld; private float PosYSpeed; private float PosZLerp = 1f; private float PosZNew; private float PosZOld; private float PosZSpeed; public void Shake(float strengthAdd, float time) { if (GameDirector.instance.currentState == GameDirector.gameState.Main && strengthAdd > Strength) { strengthAdd = ShakeMultiplier(strengthAdd); Strength += strengthAdd; Strength = Mathf.Min(Strength, StrengthMax); StrengthLossDelay = Mathf.Max(time, StrengthLossDelay); SetInstant(); } } public void ShakeDistance(float strength, float distanceMin, float distanceMax, Vector3 position, float time) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) if (GameDirector.instance.currentState == GameDirector.gameState.Main) { float num = Vector3.Distance(((Component)this).transform.position, position); float num2 = Mathf.InverseLerp(distanceMin, distanceMax, num); float num3 = strength * (1f - num2); if (num3 > Strength) { num3 = ShakeMultiplier(num3); Strength += num3; Strength = Mathf.Min(Strength, StrengthMax); StrengthLossDelay = Mathf.Max(time, StrengthLossDelay); SetInstant(); } } } private float ShakeMultiplier(float _strength) { _strength *= GameplayManager.instance.cameraShake; return _strength; } public void SetInstant() { if (InstantShake) { RotXNew = Random.Range(-1f, 1f) * RotationMultiplier * Strength; RotXLerp = 1f; RotYNew = Random.Range(-1f, 1f) * RotationMultiplier * Strength; RotYLerp = 1f; RotZNew = Random.Range(-1f, 1f) * RotationMultiplier * Strength; RotZLerp = 1f; PosXNew = Random.Range(-1f, 1f) * PositionMultiplier * Strength; PosXLerp = 1f; PosYNew = Random.Range(-1f, 1f) * PositionMultiplier * Strength; PosYLerp = 1f; PosZNew = Random.Range(-1f, 1f) * PositionMultiplier * Strength; PosZLerp = 1f; } } private void Update() { //IL_03ab: Unknown result type (might be due to invalid IL or missing references) //IL_03be: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.LerpUnclamped(RotXOld, RotXNew, Curve.Evaluate(RotXLerp)); RotXLerp += RotXSpeed * Speed * Time.deltaTime; if (RotXLerp >= 1f) { RotXOld = num; RotXNew = Random.Range(-1f, 1f) * RotationMultiplier * Strength; RotXSpeed = Random.Range(0.8f, 1.2f); RotXLerp = 0f; } float num2 = Mathf.LerpUnclamped(RotYOld, RotYNew, Curve.Evaluate(RotYLerp)); RotYLerp += RotYSpeed * Speed * Time.deltaTime; if (RotYLerp >= 1f) { RotYOld = num2; RotYNew = Random.Range(-1f, 1f) * RotationMultiplier * Strength; RotYSpeed = Random.Range(0.8f, 1.2f); RotYLerp = 0f; } float num3 = Mathf.LerpUnclamped(RotZOld, RotZNew, Curve.Evaluate(RotZLerp)); RotZLerp += RotZSpeed * Speed * Time.deltaTime; if (RotZLerp >= 1f) { RotZOld = num3; RotZNew = Random.Range(-1f, 1f) * RotationMultiplier * Strength; RotZSpeed = Random.Range(0.8f, 1.2f); RotZLerp = 0f; } float num4 = Mathf.LerpUnclamped(PosXOld, PosXNew, Curve.Evaluate(PosXLerp)); PosXLerp += PosXSpeed * Speed * Time.deltaTime; if (PosXLerp >= 1f) { PosXOld = num4; PosXNew = Random.Range(-1f, 1f) * PositionMultiplier * Strength; PosXSpeed = Random.Range(0.8f, 1.2f); PosXLerp = 0f; } float num5 = Mathf.LerpUnclamped(PosYOld, PosYNew, Curve.Evaluate(PosYLerp)); PosYLerp += PosYSpeed * Speed * Time.deltaTime; if (PosYLerp >= 1f) { PosYOld = num5; PosYNew = Random.Range(-1f, 1f) * PositionMultiplier * Strength; PosYSpeed = Random.Range(0.8f, 1.2f); PosYLerp = 0f; } float num6 = Mathf.LerpUnclamped(PosZOld, PosZNew, Curve.Evaluate(PosZLerp)); PosZLerp += PosZSpeed * Speed * Time.deltaTime; if (PosZLerp >= 1f) { PosZOld = num6; PosZNew = Random.Range(-1f, 1f) * PositionMultiplier * Strength; PosZSpeed = Random.Range(0.8f, 1.2f); PosZLerp = 0f; } ((Component)this).transform.localPosition = new Vector3(num4, num5, num6); ((Component)this).transform.localRotation = Quaternion.Euler(num, num2, num3); if (StrengthLossDelay <= 0f) { if (Strength > 0f) { Strength -= StrengthLoss * Time.deltaTime; if (Strength <= 0.1f) { Strength = 0f; } } } else { StrengthLossDelay -= 1f * Time.deltaTime; } } } public class CameraTarget : MonoBehaviour { [HideInInspector] public bool targetActiveImpulse; [HideInInspector] public bool targetActive; [HideInInspector] public float targetLerpAmount; public float targetLerpSpeed = 0.01f; public AnimationCurve targetLerpCurve; public AnimNoise camNoise; public AudioPlay targetToggleAudio; private void Update() { if (targetActiveImpulse) { if (targetActive) { if (targetActive) { targetToggleAudio.Play(1f); camNoise.NoiseOverride(1.5f, 1f, 2f, 0.5f, 0.5f); } targetActive = false; } else { if (!targetActive) { targetToggleAudio.Play(1f); camNoise.NoiseOverride(1.5f, 1f, 2f, 0.5f, 0.5f); } targetActive = true; } targetActiveImpulse = false; } if (targetActive) { targetLerpAmount = Mathf.Clamp(targetLerpAmount + targetLerpSpeed * Time.deltaTime, 0f, 1f); } else { targetLerpAmount = Mathf.Clamp(targetLerpAmount - targetLerpSpeed * Time.deltaTime, 0f, 1f); } } } public class CameraTilt : MonoBehaviour { public static CameraTilt Instance; public float tiltZ = 250f; public float tiltZMax = 10f; [Space] public float tiltX = 250f; public float tiltXMax = 10f; [Space] public float strafeAmount = 1f; public float CrouchMultiplier = 1f; private float Amount = 1f; private float AmountCurrent = 1f; private float previousX; private float previousY; private Quaternion targetAngle; [HideInInspector] public float tiltXresult; [HideInInspector] public float tiltZresult; private void Awake() { Instance = this; } private void Update() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.MenuLevel()) { ((Component)this).transform.localRotation = Quaternion.identity; return; } if (PlayerController.instance.Crouching) { AmountCurrent = Mathf.Lerp(AmountCurrent, Amount * CrouchMultiplier, Time.deltaTime * 5f); } else { AmountCurrent = Mathf.Lerp(AmountCurrent, Amount, Time.deltaTime * 5f); } float num = SemiFunc.InputMovementX(); if (GameDirector.instance.DisableInput || Object.op_Implicit((Object)(object)SpectateCamera.instance) || PlayerController.instance.InputDisableTimer > 0f) { num = 0f; } if (((Component)t