Example #1
0
    //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";
    }
Example #2
0
 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";
 }
Example #3
0
 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();
 }
Example #4
0
 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);
 }
Example #5
0
 public void SetVSync(bool sync)
 {
     _VSync = VoidUtils.BoolInt(sync);
 }
Example #6
0
 public void SetBloom(bool bloom)
 {
     _Bloom = VoidUtils.BoolInt(bloom);
 }