Commit a3468b51 authored by 赤子奈落's avatar 赤子奈落

add fps in setting

parent 243b8d25
This diff is collapsed.
...@@ -30,7 +30,7 @@ public class Menu : WindowServantSP ...@@ -30,7 +30,7 @@ public class Menu : WindowServantSP
UIHelper.registEvent(gameObject, "exit_", onClickExit); UIHelper.registEvent(gameObject, "exit_", onClickExit);
UIHelper.registEvent(gameObject, "animation_", onClickAnimation); UIHelper.registEvent(gameObject, "animation_", onClickAnimation);
//MDPRO2 update //MDPRO2 update
UIHelper.getByName<UILabel>(gameObject, "version_").text = "2.0.1"; UIHelper.getByName<UILabel>(gameObject, "version_").text = "2.0.2";
Program.I().StartCoroutine(checkUpdate()); Program.I().StartCoroutine(checkUpdate());
} }
......
...@@ -12,6 +12,7 @@ public class Setting : WindowServant2D ...@@ -12,6 +12,7 @@ public class Setting : WindowServant2D
public LAZYsetting setting; public LAZYsetting setting;
private UIPopupList _screen; private UIPopupList _screen;
private UIPopupList _aa; private UIPopupList _aa;
private UIPopupList _fps;
public float bgmVol; public float bgmVol;
public float seVol; public float seVol;
...@@ -24,10 +25,14 @@ public class Setting : WindowServant2D ...@@ -24,10 +25,14 @@ public class Setting : WindowServant2D
_screen = UIHelper.getByName<UIPopupList>(gameObject, "screen_"); _screen = UIHelper.getByName<UIPopupList>(gameObject, "screen_");
_aa = UIHelper.getByName<UIPopupList>(gameObject, "aa_"); _aa = UIHelper.getByName<UIPopupList>(gameObject, "aa_");
_aa.value = Config.Get("aa_", "无"); _aa.value = Config.Get("aa_", "无");
_fps = UIHelper.getByName<UIPopupList>(gameObject, "fps_");
_fps.value = Config.Get("fps_", "60");
changeAA(); changeAA();
changeFPS();
UIHelper.registEvent(gameObject, "exit_", onClickExit); UIHelper.registEvent(gameObject, "exit_", onClickExit);
UIHelper.registEvent(gameObject, "screen_", resizeScreen); UIHelper.registEvent(gameObject, "screen_", resizeScreen);
UIHelper.registEvent(gameObject, "aa_", changeAA); UIHelper.registEvent(gameObject, "aa_", changeAA);
UIHelper.registEvent(gameObject, "fps_", changeFPS);
UIHelper.registEvent(gameObject, "full_", resizeScreen); UIHelper.registEvent(gameObject, "full_", resizeScreen);
UIHelper.getByName<UIToggle>(gameObject, "full_").value = Screen.fullScreen; UIHelper.getByName<UIToggle>(gameObject, "full_").value = Screen.fullScreen;
UIHelper.getByName<UIToggle>(gameObject, "ignoreWatcher_").value = UIHelper.getByName<UIToggle>(gameObject, "ignoreWatcher_").value =
...@@ -101,6 +106,13 @@ public class Setting : WindowServant2D ...@@ -101,6 +106,13 @@ public class Setting : WindowServant2D
setting.field1.text = Config.Get("Field1", "随机"); setting.field1.text = Config.Get("Field1", "随机");
} }
void changeFPS()
{
if (_fps.value == "无限制")
Application.targetFrameRate = -1;
else
Application.targetFrameRate = int.Parse(_fps.value);
}
void changeAA() void changeAA()
{ {
var cameraData = Program.I().main_camera.GetUniversalAdditionalCameraData(); var cameraData = Program.I().main_camera.GetUniversalAdditionalCameraData();
...@@ -300,6 +312,7 @@ public class Setting : WindowServant2D ...@@ -300,6 +312,7 @@ public class Setting : WindowServant2D
Config.Set("showoffStar", setting.showoffStar.value); Config.Set("showoffStar", setting.showoffStar.value);
Config.Set("maximize_", UIHelper.fromBoolToString(UIHelper.isMaximized())); Config.Set("maximize_", UIHelper.fromBoolToString(UIHelper.isMaximized()));
Config.Set("aa_", _aa.value); Config.Set("aa_", _aa.value);
Config.Set("fps_", _fps.value);
} }
public void save() public void save()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment