Преглед изворни кода

多种模式公用开关记录

lvjincheng пре 4 година
родитељ
комит
d3e03b2f1c
1 измењених фајлова са 8 додато и 4 уклоњено
  1. 8 4
      Assets/BowArrow/Scripts/Game/GameAssistUI.cs

+ 8 - 4
Assets/BowArrow/Scripts/Game/GameAssistUI.cs

@@ -221,12 +221,14 @@ public class GameAssistUI : MonoBehaviour
 
     private void saveScaleAim(bool isOpen) {
         if (GameMgr.gameType == 2) return;
-        PlayerPrefs.SetInt("ScaleAim," + GameMgr.gameType + "," + LoginMgr.myUserInfo.user, isOpen ? 1 : 0);
+        int gameType = 0; //多种模式共用记录
+        PlayerPrefs.SetInt("ScaleAim," + gameType + "," + LoginMgr.myUserInfo.user, isOpen ? 1 : 0);
     }
 
     private void applyScaleAimFromRecord() {
         if (GameMgr.gameType == 2) return;
-        int saveValue = PlayerPrefs.GetInt("ScaleAim," + GameMgr.gameType + "," + LoginMgr.myUserInfo.user, 0);
+        int gameType = 0; //多种模式共用记录
+        int saveValue = PlayerPrefs.GetInt("ScaleAim," + gameType + "," + LoginMgr.myUserInfo.user, 0);
         if (saveValue == 1) {
             if (GetPropScaleAimValue() == 0) {
                 saveScaleAim(false);
@@ -240,12 +242,14 @@ public class GameAssistUI : MonoBehaviour
 
     private void saveScaleShoot(bool isOpen) {
         if (GameMgr.gameType == 2) return;
-        PlayerPrefs.SetInt("ScaleShoot," + GameMgr.gameType + "," + LoginMgr.myUserInfo.user, isOpen ? 1 : 0);
+        int gameType = 0; //多种模式共用记录
+        PlayerPrefs.SetInt("ScaleShoot," + gameType + "," + LoginMgr.myUserInfo.user, isOpen ? 1 : 0);
     }
 
     private void applyScaleShootFromRecord() {
         if (GameMgr.gameType == 2) return;
-        int saveValue = PlayerPrefs.GetInt("ScaleShoot," + GameMgr.gameType + "," + LoginMgr.myUserInfo.user, 0);
+        int gameType = 0; //多种模式共用记录
+        int saveValue = PlayerPrefs.GetInt("ScaleShoot," + gameType + "," + LoginMgr.myUserInfo.user, 0);
         if (saveValue == 1) {
             if (getScaleShootProp() == null) {
                 saveScaleShoot(false);