Commit a3791faa authored by Unicorn369's avatar Unicorn369

Change FPS

parent 664226a3
......@@ -8,6 +8,7 @@ public class LAZYsetting : MonoBehaviour {
public UISlider sliderAlpha;
public UIPopupList showoffATK;
public UIPopupList showoffStar;
public UIPopupList showoffFPS;
public UIToggle mouseEffect;
public UIToggle closeUp;
public UIToggle showoff;
......
......@@ -998,10 +998,10 @@ public class Program : MonoBehaviour
Screen.SetResolution(1300, 700, false);
}
QualitySettings.vSyncCount = 0;
Application.targetFrameRate = 144;
//Application.targetFrameRate = 144;
#elif UNITY_ANDROID || UNITY_IPHONE //Android、iPhone
Screen.SetResolution(1280, 720, true);
Application.targetFrameRate = -1;
//Application.targetFrameRate = -1;
#endif
mouseParticle = Instantiate(new_mouse);
......
using UnityEngine;
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Linq;
public class RoomList : WindowServantSP
......@@ -11,13 +8,13 @@ public class RoomList : WindowServantSP
List<string[]> listOfRooms = new List<string[]>();
bool hideAI;
bool hideStarted;
UILabel roomNameLabel;
UILabel roomPSWLabel;
public override void initialize()
{
createWindow(Program.I().new_ui_RoomList);
UIHelper.registEvent(gameObject, "exit_", onClickExit);
UIHelper.registEvent(gameObject, "refresh_", onRefresh);
roomNameLabel = UIHelper.getByName<UILabel>(gameObject, "roomNameLabel");
roomPSWLabel = UIHelper.getByName<UILabel>(gameObject, "roomNameLabel");
hideAI =UIHelper.getByName<UIToggle>(gameObject, "hideAIrooms_").value = UIHelper.fromStringToBool(Config.Get("hideAIrooms_", "1"));
hideStarted=UIHelper.getByName<UIToggle>(gameObject, "hideStarted_").value = UIHelper.fromStringToBool(Config.Get("hideStarted_", "1"));
UIHelper.registEvent(gameObject, "hideAIrooms_", save);
......@@ -54,7 +51,7 @@ public class RoomList : WindowServantSP
}
public override void hide()
{
roomNameLabel.text = "";
roomPSWLabel.text = "";
base.hide();
}
......@@ -77,17 +74,6 @@ public class RoomList : WindowServantSP
{
superScrollView.add(room[9]);
}
//for (int i = 0; i < listOfRooms.Count; i++)
//{
// //if (listOfRooms[i].Length > 4)
// //{
// // //if (/*listOfRooms[i].Substring(fileInfos[i].Name.Length - 4, 4) == ".lua"*/)
// // //{
// // // // superScrollView.add(listOfRooms[i].Substring(0, listOf.Name.Length - 4));
// // //}
// //}
//}
}
string selectedString = string.Empty;
......@@ -106,12 +92,14 @@ public class RoomList : WindowServantSP
}
selectedString = superScrollView.selectedString;
roomPsw= listOfRooms.Find(s => s[9] == selectedString)[2];
int roomNameIndex = roomPsw.LastIndexOf("#")+1;
if (roomNameIndex > 0)
if (roomPsw != null)
{
roomNameLabel.text = roomPsw.Substring(roomNameIndex);
roomPSWLabel.text = roomPsw;
}
else
{
roomPSWLabel.text = "";
}
}
void JoinRoom(string selectedString,string roomPsw)
......
......@@ -64,8 +64,10 @@ public class Setting : WindowServant2D
}
setting.showoffATK.value = Config.Get("showoffATK", "1800");
setting.showoffStar.value = Config.Get("showoffStar", "5");
setting.showoffFPS.value = Config.Get("showoffFPS", "60");
UIHelper.registEvent(setting.showoffATK.gameObject, onchangeClose);
UIHelper.registEvent(setting.showoffStar.gameObject, onchangeClose);
UIHelper.registEvent(setting.showoffFPS.gameObject, onchangeFPS);
UIHelper.registEvent(setting.mouseEffect.gameObject, onchangeMouse);
UIHelper.registEvent(setting.closeUp.gameObject, onchangeCloseUp);
UIHelper.registEvent(setting.cloud.gameObject, onchangeCloud);
......@@ -77,6 +79,16 @@ public class Setting : WindowServant2D
onchangeCloud();
}
private void onchangeFPS()
{
if (setting.showoffFPS.value == "无限制") {
Application.targetFrameRate = -1;
} else {
int FPS = int.Parse(setting.showoffFPS.value);
Application.targetFrameRate = FPS;
}
}
private void readVales()
{
try
......@@ -232,6 +244,7 @@ public class Setting : WindowServant2D
}
Config.Set("showoffATK", setting.showoffATK.value.ToString());
Config.Set("showoffStar", setting.showoffStar.value.ToString());
Config.Set("showoffFPS", setting.showoffFPS.value.ToString());
Config.Set("resize_", UIHelper.fromBoolToString(UIHelper.getByName<UIToggle>(gameObject, "resize_").value));
}
......
This diff is collapsed.
......@@ -16,7 +16,7 @@ The feedbacks is checked every day.
# How to compile the game?
1. Download Unity 5.6.6f2 (https://unity3d.com/cn/get-unity/download/archive).
1. Download Unity 5.6.7f1 (https://unity3d.com/cn/get-unity/download/archive).
2. Clone the repository.
......
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