Ver código fonte

特殊版本1

lvjincheng 3 anos atrás
pai
commit
a7f6b6db7d

+ 1 - 1
Assets/BowArrow/Scripts/Bluetooth/AimHandler.cs

@@ -250,7 +250,7 @@ public class AimHandler : MonoBehaviour
                         AutoResetView.DoIdentity();
                     }
                 } else if (bytes[0] == 0x66 && bytes[1] == 0x32) {
-                    if (SB_EventSystem.ins) {
+                    if (SB_EventSystem.ins && !CommonConfig.SpecialVersion1) {
                         //唤起/隐藏虚拟鼠标
                         SB_EventSystem.ins.AwakenSimulateMouse(); 
                     }

+ 8 - 0
Assets/BowArrow/Scripts/CommonConfig.cs

@@ -5,6 +5,14 @@ using UnityEngine;
 /**通用配置(2021/12/18新增) */
 public class CommonConfig
 {
+    /*
+        特定版本功能
+        1、长接瞄准键,出来鼠标的功能帮忙去掉
+        2、在初始状态下,就装备上五倍射程卡和二倍瞄准镜
+        3、将60寸,2.5米的5倍数更改为60寸,1.5米的3倍数
+        4、进入游戏时,默认加开启射程卡
+    */
+    public static bool SpecialVersion1 = true;
     //需要App商店审核?-标记用于特别处理某些功能
     public static bool needToExamine = false;
     //是否属于发布版本?-标记用于特别处理某些功能,比如屏蔽内部测试才有功能

+ 7 - 0
Assets/BowArrow/Scripts/Game/GameAssistUI.cs

@@ -151,6 +151,13 @@ public class GameAssistUI : MonoBehaviour
 
     void LoadMyRecord() {
         int gameType = 0; //多种模式共用记录
+        if (CommonConfig.SpecialVersion1) {
+            if (PlayerPrefs.GetInt("sv1_ScaleAimShoot," + LoginMgr.myUserInfo.id, 0) == 0) {
+                PlayerPrefs.SetInt("sv1_ScaleAimShoot," + LoginMgr.myUserInfo.id, 1);
+                PlayerPrefs.SetInt("ScaleAim," + gameType + "," + LoginMgr.myUserInfo.id, 0);
+                PlayerPrefs.SetInt("ScaleShoot," + gameType + "," + LoginMgr.myUserInfo.id, 1);
+            }
+        }
         bool isScaleAimOpen = PlayerPrefs.GetInt("ScaleAim," + gameType + "," + LoginMgr.myUserInfo.id, 0) == 1 ? true : false;
         bool isScaleShootOpen = PlayerPrefs.GetInt("ScaleShoot," + gameType + "," + LoginMgr.myUserInfo.id, 0) == 1 ? true : false;
         if (isScaleAimOpen && GetPropScaleAimValue() == 0) {

+ 9 - 0
Assets/BowArrow/Scripts/Manager/LoginMgr/LoginMgr.cs

@@ -117,6 +117,15 @@ public class UserSettings {
                 if (_ins == null) {
                     _ins = new UserSettings();
                 }
+                if (CommonConfig.SpecialVersion1) {
+                    if (PlayerPrefs.GetInt("sv1_UserSettings", 0) == 0) {
+                        PlayerPrefs.SetInt("sv1_UserSettings", 1);
+                        UserSettings us = _ins;
+                        us.bowRotateConvert.screenSize = 60;
+                        us.bowRotateConvert.screenDistance = 1.5f;
+                        us.Save();
+                    }
+                }
             }
             return _ins;
         }

+ 50 - 7
Assets/BowArrow/Scripts/Manager/PropMgr.cs

@@ -56,6 +56,7 @@ public class PropMgr {
     public List<PropInfo> ListForBag()
     {
         List<PropInfo> list = LoginMgr.myUserInfo.bagList;
+        if (CommonConfig.SpecialVersion1) list = GetDebugLocalBagList();
         foreach (var propInfo in list)
         {
             propInfo.config = (PropConfig) propConfigs[propInfo.id];
@@ -65,7 +66,9 @@ public class PropMgr {
     public List<PropInfo> ListForEquipped()
     {
         List<PropInfo> list = new List<PropInfo>();
-        foreach (var propInfo in LoginMgr.myUserInfo.bagList)
+        List<PropInfo> myProps = LoginMgr.myUserInfo.bagList;
+        if (CommonConfig.SpecialVersion1) myProps = GetDebugLocalBagList();
+        foreach (var propInfo in myProps)
         {   
             if (propInfo.inuse) {
                 propInfo.config = (PropConfig) propConfigs[propInfo.id];
@@ -80,6 +83,7 @@ public class PropMgr {
         if (propConfig.type == 1 || propConfig.type == 2) 
         {
             List<PropInfo> myProps = LoginMgr.myUserInfo.bagList;
+            if (CommonConfig.SpecialVersion1) myProps = GetDebugLocalBagList();
             foreach (var myProp in myProps)
             {
                 if (myProp.id == propConfig.id && myProp.count > 0) return true;
@@ -114,16 +118,55 @@ public class PropMgr {
             }
         }
         propInfo.inuse = !propInfo.inuse;
+        if (CommonConfig.SpecialVersion1) {
+            SaveDebugLocalBagList();
+            return propInfo.inuse;
+        }
         LoginMgr.myUserInfo.Save();
         return propInfo.inuse;
     }
 
-    public void DebugAddAndUseProp(int id)
-    {
-        PropInfo propInfo = new PropInfo();
-        propInfo.id = id;
-        propInfo.inuse = true;
-        LoginMgr.myUserInfo.bagList.Add(propInfo);
+    private List<PropInfo> _debugLocalBagList;
+    private int _debugLocalBagList_uid = -1;
+    private List<PropInfo> GetDebugLocalBagList() {
+        if (_debugLocalBagList_uid != LoginMgr.myUserInfo.id) {
+            _debugLocalBagList_uid = LoginMgr.myUserInfo.id;
+            _debugLocalBagList = null;
+        }
+        if (_debugLocalBagList == null) {
+            try {
+                string str = PlayerPrefs.GetString("sv1_baglist," + LoginMgr.myUserInfo.id, null);
+                _debugLocalBagList = JsonConvert.DeserializeObject<List<PropInfo>>(str);
+            } catch (System.Exception) {}
+            if (_debugLocalBagList == null) {
+                _debugLocalBagList = new List<PropInfo>();
+                for (int i = 2; i <= 5; i++) {
+                    PropInfo propInfo = new PropInfo();
+                    propInfo.id = 10 + i;
+                    propInfo.count = 1;
+                    _debugLocalBagList.Add(propInfo);
+                    if (propInfo.id == 12) {
+                        propInfo.inuse = true;
+                    }
+                }
+                for (int i = 2; i <= 5; i++) {
+                    PropInfo propInfo = new PropInfo();
+                    propInfo.id = 20 + i;
+                    propInfo.count = 1;
+                    _debugLocalBagList.Add(propInfo);
+                    if (propInfo.id == 25) {
+                        propInfo.inuse = true;
+                    }
+                }
+            }
+        }
+        return _debugLocalBagList;
+    }
+    private void SaveDebugLocalBagList() {
+        if (_debugLocalBagList != null) {
+            string str = JsonConvert.SerializeObject(_debugLocalBagList);
+            PlayerPrefs.SetString("sv1_baglist," + LoginMgr.myUserInfo.id, str);
+        }
     }
 }
 public class PropInfo {