From 589103d684a7affd02e752c8e7c31af271189e1e Mon Sep 17 00:00:00 2001
From: client_linchunjie <461730578@qq.com>
Date: 星期五, 31 八月 2018 10:11:08 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
---
Core/GameEngine/Login/Launch.cs | 2
Fight/Stage/StageManager.cs | 2
System/SystemSetting/SystemSetting.cs | 59 +++++++++++++++--------------
System/MainInterfacePanel/MainInterfaceWin.cs | 6 ++-
System/SystemSetting/SystemSetWin.cs | 14 +++---
5 files changed, 44 insertions(+), 39 deletions(-)
diff --git a/Core/GameEngine/Login/Launch.cs b/Core/GameEngine/Login/Launch.cs
index 044551c..24a4d06 100644
--- a/Core/GameEngine/Login/Launch.cs
+++ b/Core/GameEngine/Login/Launch.cs
@@ -45,7 +45,7 @@
SoundPlayer.CreateSoundPlayer();
SoundPlayer.Instance.PlayLoginMusic();
SystemSetting.Instance.SetSoundVolume(SystemSetting.Instance.GetSoundVolume());
- SystemSetting.Instance.SetGameFrame(SystemSetting.Instance.GetGameFrame());
+ SystemSetting.Instance.SetGameFps(SystemSetting.Instance.GetGameFps());
SDKUtility.Instance.Init();
GameObjectPoolManager.Instance.gameObject.name = "GameObjectPool";
diff --git a/Fight/Stage/StageManager.cs b/Fight/Stage/StageManager.cs
index ca39550..7e85cb4 100644
--- a/Fight/Stage/StageManager.cs
+++ b/Fight/Stage/StageManager.cs
@@ -379,7 +379,7 @@
DebugEx.LogFormat("StageManager => Load Scene : {0} Finished.", _resources);
WindowCenter.Instance.Close<LoadingWin>();
- SystemSetting.Instance.SetFPSLimit(SystemSetting.Instance.GetFPSLimit());
+ SystemSetting.Instance.SetGameFps(SystemSetting.Instance.GetGameFps());
}
diff --git a/System/MainInterfacePanel/MainInterfaceWin.cs b/System/MainInterfacePanel/MainInterfaceWin.cs
index 3a5d454..772b49d 100644
--- a/System/MainInterfacePanel/MainInterfaceWin.cs
+++ b/System/MainInterfacePanel/MainInterfaceWin.cs
@@ -1052,9 +1052,11 @@
private void bossGrabHintEvent()
{
IsShowTaskPanel();
- if (!fairyGrabBossModel.grabBossHintOpen && Buffmodel.PkType != 0)
+ int mapID = PlayerDatas.Instance.baseData.MapID;
+ var config = Config.Instance.Get<MapConfig>(mapID);
+ if (!fairyGrabBossModel.grabBossHintOpen && Buffmodel.PkType != config.Camp)
{
- DTCA202_tagMCAttackMode.Send_SwitchAttackMode((E_AttackMode)0);
+ DTCA202_tagMCAttackMode.Send_SwitchAttackMode((E_AttackMode)config.Camp);
}
}
}
diff --git a/System/SystemSetting/SystemSetWin.cs b/System/SystemSetting/SystemSetWin.cs
index b50a600..37d4d9d 100644
--- a/System/SystemSetting/SystemSetWin.cs
+++ b/System/SystemSetting/SystemSetWin.cs
@@ -82,7 +82,7 @@
UpdateToggleSkin(m_OtherPlayer);
UpdateToggleSkin(m_Monster);
- m_SixtyFrame.isOn = SystemSetting.Instance.GetGameFrame() == GameFrame.FullFrame;
+ m_SixtyFrame.isOn = SystemSetting.Instance.GetGameFps() == GameFps.Full;
var serverName = ServerListCenter.Instance.GetServerData(ServerListCenter.Instance.currentServer.region_flag).name;
var playerAccount = PlayerDatas.Instance.baseData.AccID.Split('@');
@@ -182,7 +182,7 @@
SystemSetting.Instance.SetQualityLevel(GameQuality.Low);
if (isInited)
{
- SystemSetting.Instance.SetGameFrame(GameFrame.HalfFrame);
+ SystemSetting.Instance.SetGameFps(GameFps.Half);
SystemSetting.Instance.SetPlayerSyncCount(5);
}
}
@@ -192,21 +192,21 @@
private void SwitchGameFrame()
{
- var gameFrame = SystemSetting.Instance.GetGameFrame();
+ var gameFrame = SystemSetting.Instance.GetGameFps();
- if (gameFrame==GameFrame.HalfFrame)
+ if (gameFrame == GameFps.Half)
{
- SystemSetting.Instance.SetGameFrame(GameFrame.FullFrame);
+ SystemSetting.Instance.SetGameFps(GameFps.Full);
}
else
{
- SystemSetting.Instance.SetGameFrame(GameFrame.HalfFrame);
+ SystemSetting.Instance.SetGameFps(GameFps.Half);
}
}
private void OnSwitchGameFrame()
{
- m_SixtyFrame.isOn = SystemSetting.Instance.GetGameFrame() == GameFrame.FullFrame;
+ m_SixtyFrame.isOn = SystemSetting.Instance.GetGameFps() == GameFps.Full;
}
private void OnShowOrHideOtherPlayers(bool _value)
diff --git a/System/SystemSetting/SystemSetting.cs b/System/SystemSetting/SystemSetting.cs
index bf704ad..a6412d8 100644
--- a/System/SystemSetting/SystemSetting.cs
+++ b/System/SystemSetting/SystemSetting.cs
@@ -11,7 +11,6 @@
const string QUALITY_LEVEL_KEY = "GameQualityLevel";
const string SOUND_VOLUME_KEY = "SoundRatioKey"; //闊充箰
const string SOUND_EFFECT_KEY = "SoundEffect"; //闊虫晥
- const string FPS_KEY = "FPSKey";
const string GAMEFRAME_KEY = "GameFrameSetting";//鍨傜洿鍚屾鐜�
public Dictionary<SystemSwitch, bool> systemSettings = new Dictionary<SystemSwitch, bool>();
@@ -54,19 +53,19 @@
return LocalSave.GetFloat(SOUND_EFFECT_KEY, 1);
}
- public void SetGameFrame(GameFrame _frame)
+ public void SetGameFps(GameFps _frame)
{
LocalSave.SetInt(GAMEFRAME_KEY, (int)_frame);
- SetFPSLimit((int)_frame);
+ Application.targetFrameRate = Mathf.Clamp((int)_frame, 30, 60);
if (gameFrameChangeEvent != null)
{
gameFrameChangeEvent();
}
}
- public GameFrame GetGameFrame()
+ public GameFps GetGameFps()
{
- return (GameFrame)LocalSave.GetInt(GAMEFRAME_KEY, (int)GameFrame.FullFrame);
+ return (GameFps)LocalSave.GetInt(GAMEFRAME_KEY, (int)GameFps.Full);
}
public void SetSystemSettingSwitch(SystemSwitch type, bool _value)
@@ -191,18 +190,18 @@
{
var defaultQuality = GameQuality.High;
-// if (DeviceUtility.cpu >= 4 && DeviceUtility.memory > 3.5f * 1024)
-// {
-// defaultQuality = GameQuality.High;
-// }
-// else if (DeviceUtility.cpu >= 4 && DeviceUtility.memory > 2.5f * 1024)
-// {
-// defaultQuality = GameQuality.Medium; ;
-// }
-// else if (DeviceUtility.cpu > 1 && DeviceUtility.memory > 1.5f * 1024)
-// {
-// defaultQuality = GameQuality.Low;
-// }
+ // if (DeviceUtility.cpu >= 4 && DeviceUtility.memory > 3.5f * 1024)
+ // {
+ // defaultQuality = GameQuality.High;
+ // }
+ // else if (DeviceUtility.cpu >= 4 && DeviceUtility.memory > 2.5f * 1024)
+ // {
+ // defaultQuality = GameQuality.Medium; ;
+ // }
+ // else if (DeviceUtility.cpu > 1 && DeviceUtility.memory > 1.5f * 1024)
+ // {
+ // defaultQuality = GameQuality.Low;
+ // }
return (GameQuality)LocalSave.GetInt(QUALITY_LEVEL_KEY, (int)defaultQuality);
}
@@ -217,15 +216,7 @@
}
}
- public void SetFPSLimit(int _fps)
- {
- Application.targetFrameRate = Mathf.Clamp(_fps, 30, 60);
- }
- public int GetFPSLimit()
- {
- return (int)GetGameFrame();
- }
public void LetFPSUnLimit()
{
@@ -236,6 +227,18 @@
{
systemSettings.Clear();
m_PlayerSyncCount = -1;
+ }
+
+ private GameFps GetRecommendFps()
+ {
+ if (Screen.width * Screen.height > (1920 * 1080 + 10000))
+ {
+ return GameFps.Half;
+ }
+ else
+ {
+ return GameFps.Full;
+ }
}
IEnumerator Co_WaitFewMinute()
@@ -266,9 +269,9 @@
High = 2,
}
-public enum GameFrame
+public enum GameFps
{
Free = -1,
- HalfFrame = 30,
- FullFrame = 60,
+ Half = 30,
+ Full = 60,
}
\ No newline at end of file
--
Gitblit v1.8.0