using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TMPro;
public class VideoandAudio : MonoBehaviour
{
public Toggle fulltog, vtog;
public List resolutions = new List();
private int selectedResolution;
public TMP_Text resolutionLabel;
// Start is called before the first frame update
void Start()
{
fulltog.isOn = Screen.fullScreen;
if (QualitySettings.vSyncCount == 0)
{
vtog.isOn = false;
} else
{
vtog.isOn = true;
}
bool foundRes = false;
for(int i = 0; i < resolutions.Count; i++)
{
if (Screen.width = resolutions_.horizontal + Screen.height == resolutions*.vertical) ;_
_{_
foundRes = true;
selectedResolution = i;
UpdateResLabel();
_}_
_}_
_}_
_// Update is called once per frame*_
void Update()
{
}
public void resleft()
{
selectedResolution–;
if(selectedResolution < 0)
{
selectedResolution = 0;
}
UpdateResLabel();
}
public void resright()
{
selectedResolution++;
if (selectedResolution > resolutions.Count - 1)
{
selectedResolution = resolutions.Count - 1;
}
UpdateResLabel();
}
public void UpdateResLabel()
{
resolutionLabel.text = resolutions[selectedResolution].horizontal.ToString() + " x " + resolutions[selectedResolution].vertical.ToString();
}
public void ApplyChanges()
{
Screen.fullScreen = fulltog.isOn;
if (vtog.isOn)
{
QualitySettings.vSyncCount = 1;
}
else
{
QualitySettings.vSyncCount = 0;
}
Screen.SetResolution(resolutions[selectedResolution].horizontal, resolutions[selectedResolution].vertical, fulltog.isOn);
}
}
[System.Serializable]
public class ResItem
{
public int horizontal, vertical;
}