//Change values displayed on the HUD void UpdateHUD() { Vector3 scale = healthBar.localScale; healthBar.localScale = new Vector3(Mathf.Lerp(scale.x, Screen.width * (_curHealth / 100), Time.deltaTime * 5f), scale.y, scale.z); distanceDisplay.text = VoidUtils.Round(_thisTransform.position.x + _distance, 100) + "m"; }
void Update() { frameCount++; dt += Time.deltaTime; if (dt > 1.0f / updateRate) { fps = frameCount / dt; frameCount = 0; dt -= 1.0f / updateRate; } fpsText.text = VoidUtils.Round(fps, 100) + " FPS"; }
public void LoadPrefs() { masterVol.value = _masterVol = PlayerPrefs.GetFloat("MasterVol", 100); masterVolNum.text = _masterVol.ToString(); effectVol.value = _effectVol = PlayerPrefs.GetFloat("EffectVol", 100); effectVolNum.text = _effectVol.ToString(); musicVol.value = _musicVol = PlayerPrefs.GetFloat("MusicVol", 100); musicVolNum.text = _effectVol.ToString(); _VSync = PlayerPrefs.GetInt("VSync", 1); _Bloom = PlayerPrefs.GetInt("Bloom", 1); VSync.isOn = VoidUtils.IntBool(_VSync); Bloom.isOn = VoidUtils.IntBool(_Bloom); ApplyOptions(); }
void ApplyOptions() { //Volumes GameRegistry.EFFECT_VOL = (_effectVol / 100); GameRegistry.MUSIC_VOL = (_musicVol / 100); SoundController[] audio = GameObject.FindObjectsOfType <SoundController>() as SoundController[]; foreach (SoundController s in audio) { s.UpdateVolumes(); } //Bloom Camera.main.GetComponent <BloomOptimized>().enabled = VoidUtils.IntBool(_Bloom); //VSync QualitySettings.vSyncCount = _VSync; //Save Settings PlayerPrefs.SetFloat("MasterVol", _masterVol); PlayerPrefs.SetFloat("EffectVol", _effectVol); PlayerPrefs.SetFloat("MusicVol", _musicVol); PlayerPrefs.SetInt("VSync", _VSync); PlayerPrefs.SetInt("Bloom", _Bloom); }
public void SetVSync(bool sync) { _VSync = VoidUtils.BoolInt(sync); }
public void SetBloom(bool bloom) { _Bloom = VoidUtils.BoolInt(bloom); }