Browse Source

1.修改b端适配

slambb 11 tháng trước cách đây
mục cha
commit
17b60d12bb

+ 1 - 0
Assets/BowArrow/Scenes/GameChallengeScene/GameChallenge.unity

@@ -49388,6 +49388,7 @@ MonoBehaviour:
   languageFontSizes:
   - language: 1
     fontSize: 18
+    lineSpacing: 0
 --- !u!114 &2142579591
 MonoBehaviour:
   m_ObjectHideFlags: 0

+ 5 - 0
Assets/BowArrow/Scripts/Bluetooth/AimHandler.cs

@@ -439,17 +439,22 @@ public class AimDeviceInfos
             else if (bytes[0] == 0x5E)
             {
                 Debug.Log("接收到系统数据:" + BitConverter.ToString(bytes));
+                var boxUserSettings = FindAnyObjectByType<CustomUIView.BoxUserSettings>();
                 //设备类型
                 switch (bytes[1])
                 {
                     case 0x01:
                         Debug.Log("设备类型:HOUYI Pro");
+                        //刷新界面
+                        boxUserSettings?.OnUpdateClickInfoByName("HOUYI Pro");
                         break;
                     case 0x02:
                         Debug.Log("设备类型:ARTEMIS Pro");
+                        boxUserSettings?.OnUpdateClickInfoByName("ARTEMIS Pro");
                         break;
                     case 0x03:
                         Debug.Log("设备类型:Pistol 1");
+                        boxUserSettings?.OnUpdateClickInfoByName("Pistol M9");
                         break;
                 }
 

+ 10 - 2
Assets/BowArrow/Scripts/CommonConfig.cs

@@ -7,7 +7,7 @@ using UnityEngine;
 public class CommonConfig
 {
     //青凤鸾 WONDERFITTER ,WONDER FITTER Pro ,WONDER FITTER 运动
-    public static readonly string[] AppNames = { "WONDER FITTER Pro", "WONDER FITTER" };
+    public static readonly string[] AppNames = { "WONDER FITTER Pro", "WONDER FITTER" , "WONDERFITTER PRO B" };
     //App地区(0:国内版;1:海外版;)
     public static int AppArea
     {
@@ -19,7 +19,15 @@ public class CommonConfig
             int index = Application.identifier == "com.xmjssvr.BowArrow" ? 0 : 1;//海外版 com.xmjssvr.BowArrowEn
 #endif
 #if UNITY_ANDROID
-            int index = Application.identifier == "com.xmjssvr.BowArrow.mi" ? 0 : 1;//海外版 com.xmjssvr.BowArrowEn
+            int index = 0;
+            if (StandaloneModeOrPlatformB)
+            {
+                //b端
+                index = Application.identifier == "com.xmjssvr.BowArrow.miBClient" ? 0 : 1;//海外版 com.xmjssvr.BowArrowEn
+            }
+            else { 
+                index = Application.identifier == "com.xmjssvr.BowArrow.mi" ? 0 : 1;//海外版 com.xmjssvr.BowArrowEn
+            }  
 #endif
 #if UNITY_STANDALONE_WIN
             //pc版

+ 13 - 5
Assets/BowArrow/Scripts/Editor/MenuChangeAppLanguage.cs

@@ -13,13 +13,21 @@ public class MenuChangeAppLanguage
     [MenuItem("APP语言版本切换/中文")]
     static void ToCN() 
     {
-        PlayerSettings.productName = CommonConfig.AppNames[0];
-        #if UNITY_IOS
+        PlayerSettings.productName = CommonConfig.StandaloneModeOrPlatformB ? CommonConfig.AppNames[2]: CommonConfig.AppNames[0];
+#if UNITY_IOS
         PlayerSettings.SetApplicationIdentifier(BuildTargetGroup.iOS, "com.xmjssvr.BowArrow");
-        #endif
-        #if UNITY_ANDROID
-        PlayerSettings.SetApplicationIdentifier(BuildTargetGroup.Android, "com.xmjssvr.BowArrow.mi"); //com.xmjssvr.BowArrow
 #endif
+#if UNITY_ANDROID
+        if (CommonConfig.StandaloneModeOrPlatformB)
+        {
+
+            PlayerSettings.SetApplicationIdentifier(BuildTargetGroup.Android, "com.xmjssvr.BowArrow.miBClient"); //com.xmjssvr.BowArrow
+        }
+        else {
+
+            PlayerSettings.SetApplicationIdentifier(BuildTargetGroup.Android, "com.xmjssvr.BowArrow.mi"); //com.xmjssvr.BowArrow
+        }
+ #endif
         SetIosAppIcon(0);
     }
 

+ 4 - 0
Assets/BowArrow/Scripts/Manager/AudioMgr.cs

@@ -113,6 +113,10 @@ public class AudioMgr : MonoBehaviour
     }
 
     public void PlayAnimalEffect(string name, AudioSource audioSource) {
+        if (name == "rabbit_injured") {
+            audioSource.volume = 1;
+            Debug.Log("兔子音效 Volume =" + audioSource.volume);
+        }
         this.Play("Audios/Animal/" + name, audioSource);
     }
 

+ 13 - 0
Assets/SmartBow/Scripts/Views/SettingsViewParts/BoxUserSettings.cs

@@ -123,6 +123,19 @@ namespace CustomUIView
             ViewManager2.ShowView(ViewManager2.Path_InfraredView);
 
         }
+        /// <summary>
+        /// 根据名字刷新渲染
+        /// </summary>
+        /// <param name="deviceName"></param>
+        public void OnUpdateClickInfoByName(string deviceName) {
+            // 如果名称存在于数组中,则获取其索引,否则默认选第一个
+            selectDevicesIndex = System.Array.IndexOf(SelectDevicesStrs, deviceName);
+            if (selectDevicesIndex < 0) selectDevicesIndex = 0;
+            UserSettings.ins.selectDevicesName = SelectDevicesStrs[selectDevicesIndex];
+            UserSettings.ins.Save();
+            // 渲染选择的设备
+            RenderSelectDevicesIndex(selectDevicesIndex);
+        }
 
         // Update is called once per frame
         //void Update()