Beispiel #1
0
    void LoadSettings()
    {
        _texQualityNames.Clear();
        _texQualityNames.Add("Full");
        _texQualityNames.Add("Half");
        _texQualityNames.Add("Quarter");
        _texQualityNames.Add("Eight");

        GameObject gameReg = GameObject.Find("_GameRegistry");

        _data        = gameReg.GetComponent <DataMap>();
        _controls    = gameReg.GetComponent <ControlMap>();
        _setControls = _controls;
        //Gameplay
        _mouseMode = _data.GetBool("MouseMode");
        //Audio
        _bgmVol    = _data.GetFloat("BGM_Vol");
        _sfxVol    = _data.GetFloat("SFX_Vol");
        _masterVol = _data.GetFloat("Master_Vol");
        //Video
        _vSync       = _data.GetBool("VSync");
        _resHeight   = _data.GetInt("Res_Height");
        _resWidth    = _data.GetInt("Res_Width");
        _resRefresh  = _data.GetInt("Res_Refresh");
        _AA          = _data.GetInt("Anti_Aliasing");
        _aniso       = _data.GetBool("Aniso_Filtering");
        _texQuality  = _data.GetInt("Tex_Quality");
        _fullscreen  = _data.GetBool("Fullscreen");
        _resolutions = Screen.resolutions;

        int i = 0;

        foreach (Resolution r in _resolutions)
        {
            Debug.Log(r.width + ":" + _resWidth + " | " + r.height + ":" + _resHeight + " | " + r.refreshRate + ":" + _resRefresh);
            if (r.width == _resWidth)
            {
                if (r.height == _resHeight)
                {
                    if (r.refreshRate == _resRefresh)
                    {
                        _resIndex = i;
                        break;
                    }
                }
            }
            i++;
        }
    }
Beispiel #2
0
 // Use this for initialization
 void Start()
 {
     _curPower = 0;
     _bGunner  = GetComponent <BeamGunner>();
     CreateBulletPool();
     _controls     = GameObject.Find("_GameRegistry").GetComponent <ControlMap>();
     _data         = GameObject.Find("_GameRegistry").GetComponent <DataMap>();
     _nextFireTime = Time.time + fireRate;
     _health       = maxHealth;
     _cam          = Camera.main.transform;
     _mouseMode    = _data.GetBool("MouseMode");
 }