// Token: 0x0600060A RID: 1546 RVA: 0x00033990 File Offset: 0x00031B90 private void LoadSettings() { ZInput.instance.Load(); AudioListener.volume = PlayerPrefs.GetFloat("MasterVolume", AudioListener.volume); MusicMan.m_masterMusicVolume = PlayerPrefs.GetFloat("MusicVolume", 1f); AudioMan.SetSFXVolume(PlayerPrefs.GetFloat("SfxVolume", 1f)); this.m_continousMusic.isOn = (PlayerPrefs.GetInt("ContinousMusic", 1) == 1); PlayerController.m_mouseSens = PlayerPrefs.GetFloat("MouseSensitivity", PlayerController.m_mouseSens); PlayerController.m_invertMouse = (PlayerPrefs.GetInt("InvertMouse", 0) == 1); float @float = PlayerPrefs.GetFloat("GuiScale", 1f); this.m_volumeSlider.value = AudioListener.volume; this.m_sensitivitySlider.value = PlayerController.m_mouseSens; this.m_sfxVolumeSlider.value = AudioMan.GetSFXVolume(); this.m_musicVolumeSlider.value = MusicMan.m_masterMusicVolume; this.m_guiScaleSlider.value = @float * 100f; this.m_invertMouse.isOn = PlayerController.m_invertMouse; this.m_gamepadEnabled.isOn = ZInput.IsGamepadEnabled(); this.m_languageKey = Localization.instance.GetSelectedLanguage(); this.m_language.text = Localization.instance.Localize("$language_" + this.m_languageKey.ToLower()); this.m_cameraShake.isOn = (PlayerPrefs.GetInt("CameraShake", 1) == 1); this.m_shipCameraTilt.isOn = (PlayerPrefs.GetInt("ShipCameraTilt", 1) == 1); this.m_quickPieceSelect.isOn = (PlayerPrefs.GetInt("QuickPieceSelect", 0) == 1); this.m_showKeyHints.isOn = (PlayerPrefs.GetInt("KeyHints", 1) == 1); this.m_dofToggle.isOn = (PlayerPrefs.GetInt("DOF", 1) == 1); this.m_vsyncToggle.isOn = (PlayerPrefs.GetInt("VSync", 0) == 1); this.m_bloomToggle.isOn = (PlayerPrefs.GetInt("Bloom", 1) == 1); this.m_ssaoToggle.isOn = (PlayerPrefs.GetInt("SSAO", 1) == 1); this.m_sunshaftsToggle.isOn = (PlayerPrefs.GetInt("SunShafts", 1) == 1); this.m_aaToggle.isOn = (PlayerPrefs.GetInt("AntiAliasing", 1) == 1); this.m_caToggle.isOn = (PlayerPrefs.GetInt("ChromaticAberration", 1) == 1); this.m_motionblurToggle.isOn = (PlayerPrefs.GetInt("MotionBlur", 1) == 1); this.m_softPartToggle.isOn = (PlayerPrefs.GetInt("SoftPart", 1) == 1); this.m_tesselationToggle.isOn = (PlayerPrefs.GetInt("Tesselation", 1) == 1); this.m_shadowQuality.value = (float)PlayerPrefs.GetInt("ShadowQuality", 2); this.m_lod.value = (float)PlayerPrefs.GetInt("LodBias", 2); this.m_lights.value = (float)PlayerPrefs.GetInt("Lights", 2); this.m_vegetation.value = (float)PlayerPrefs.GetInt("ClutterQuality", 2); this.m_fullscreenToggle.isOn = Screen.fullScreen; this.m_oldFullscreen = this.m_fullscreenToggle.isOn; this.m_oldRes = Screen.currentResolution; this.m_oldRes.width = Screen.width; this.m_oldRes.height = Screen.height; this.m_selectedRes = this.m_oldRes; ZLog.Log(string.Concat(new object[] { "Current res ", Screen.currentResolution.width, "x", Screen.currentResolution.height, " ", Screen.width, "x", Screen.height })); }
// Token: 0x060009F2 RID: 2546 RVA: 0x00047F50 File Offset: 0x00046150 private void Awake() { if (AudioMan.m_instance != null) { ZLog.Log("Audioman already exist, destroying self"); UnityEngine.Object.DestroyImmediate(base.gameObject); return; } AudioMan.m_instance = this; UnityEngine.Object.DontDestroyOnLoad(base.gameObject); GameObject gameObject = new GameObject("ocean_ambient_loop"); gameObject.transform.SetParent(base.transform); this.m_oceanAmbientSource = gameObject.AddComponent <AudioSource>(); this.m_oceanAmbientSource.loop = true; this.m_oceanAmbientSource.spatialBlend = 0.75f; this.m_oceanAmbientSource.outputAudioMixerGroup = this.m_ambientMixer; this.m_oceanAmbientSource.maxDistance = 128f; this.m_oceanAmbientSource.minDistance = 40f; this.m_oceanAmbientSource.spread = 90f; this.m_oceanAmbientSource.rolloffMode = AudioRolloffMode.Linear; this.m_oceanAmbientSource.clip = this.m_oceanAudio; this.m_oceanAmbientSource.bypassReverbZones = true; this.m_oceanAmbientSource.dopplerLevel = 0f; this.m_oceanAmbientSource.volume = 0f; this.m_oceanAmbientSource.Play(); GameObject gameObject2 = new GameObject("ambient_loop"); gameObject2.transform.SetParent(base.transform); this.m_ambientLoopSource = gameObject2.AddComponent <AudioSource>(); this.m_ambientLoopSource.loop = true; this.m_ambientLoopSource.spatialBlend = 0f; this.m_ambientLoopSource.outputAudioMixerGroup = this.m_ambientMixer; this.m_ambientLoopSource.bypassReverbZones = true; this.m_ambientLoopSource.volume = 0f; GameObject gameObject3 = new GameObject("wind_loop"); gameObject3.transform.SetParent(base.transform); this.m_windLoopSource = gameObject3.AddComponent <AudioSource>(); this.m_windLoopSource.loop = true; this.m_windLoopSource.spatialBlend = 0f; this.m_windLoopSource.outputAudioMixerGroup = this.m_ambientMixer; this.m_windLoopSource.bypassReverbZones = true; this.m_windLoopSource.clip = this.m_windAudio; this.m_windLoopSource.volume = 0f; this.m_windLoopSource.Play(); if (SystemInfo.graphicsDeviceType == GraphicsDeviceType.Null) { AudioListener.volume = 0f; return; } AudioListener.volume = PlayerPrefs.GetFloat("MasterVolume", AudioListener.volume); AudioMan.SetSFXVolume(PlayerPrefs.GetFloat("SfxVolume", AudioMan.GetSFXVolume())); }
public static void Prefix(Player __instance) { if (CustomInput.GetKeyDown("ToggleAllRewards")) { new Thread(() => { Plugin.Instance.ToggleRewards(!Plugin.Instance.isRewardsEnabled); }).Start(); } if (!Plugin.Instance.isInGame || !CustomInput.GetKeyDown("Whistle")) { return; } PlayerLoadPatch.Whistle(AudioMan.GetSFXVolume()); foreach (var character in CharacterAwakePatch.tamedCharacters) { var znview = character.GetComponent <ZNetView>(); if (znview == null) { continue; } var zdo = znview.GetZDO(); if (zdo == null) { continue; } var customName = zdo.GetString($"{Plugin.GUID}-name"); if (customName.Length == 0) { return; } var ai = character.GetComponent <MonsterAI>(); ai.SetFollowTarget(__instance.gameObject); } }