我需要一些帮助,我尝试在带有统一GUI的C#中添加自定义分辨率更改器。
this.WeightRez = GUI.TextField(new Rect(300f, 250f, 90f, 25f), this.WeightRez, 6);
if (GUI.Button(new Rect(350f, 0f, 0f, 0f), ""))
{
if (int.TryParse(this.WeightRez, out this.WeightRezFloat))
{
this.WeightRezFloat = int.Parse(this.WeightRez);
} else {
this.HeightRez = "ERROR";
}
}
this.HeightRez = GUI.TextField(new Rect(260f, 0f, 90f, 25f), this.HeightRez, 6);
if (GUI.Button(new Rect(300f, 230f, 90f, 0f), ""))
{
if (int.TryParse(this.HeightRez, out this.HeightRezFloat))
{
this.HeightRezFloat = int.Parse(this.HeightRez);
} else {
this.HeightRez = "ERROR";
}
}
if (GUI.Button(new Rect(450f, 0f, 120f, 25f), "Set"))
{
Screen.SetResolution(this.WeightRezFloat, this.HeightRezFloat, true);
}
它不会工作 谢谢你能帮我