lvjincheng 2 лет назад
Родитель
Сommit
13a9e0ca3b

+ 13 - 5
Assets/BowArrow/Scripts/CommonConfig.cs

@@ -6,13 +6,16 @@ using UnityEngine;
 /**通用配置(2021/12/18新增) */
 public class CommonConfig
 {
-    public static readonly string[] AppNames = {"青凤鸾", "HOUYI"};
-    public static readonly int[] AppLanguages = {0, 1};
-    public static readonly int[] ServerIndexes = {0, 1};
+    public static readonly string[] AppNames = {"青凤鸾", "HOUYI", "WONDER FITTER"};
     //根据产品名决定默认语言
     public static int AppLanguage 
     {
-        get => AppLanguages[Array.IndexOf(AppNames, Application.productName)];
+        get
+        {
+            int index = Array.IndexOf(AppNames, Application.productName);
+            if (index == 0) return 0;
+            else return 1;
+        }
     }
     //禁止语言切换(ios安全上架)
     public static bool banLanguageChangeSwitch { get => Application.platform ==  RuntimePlatform.IPhonePlayer; }
@@ -64,6 +67,11 @@ public class CommonConfig
     public static string gamePKServerWsURL;
     public static int serverIndex
     {
-        get => ServerIndexes[Array.IndexOf(AppNames, Application.productName)];
+        get
+        {
+            int index = Array.IndexOf(AppNames, Application.productName);
+            if (index == 0) return 0;
+            else return 1;
+        }
     }
 }

+ 7 - 0
Assets/BowArrow/Scripts/Editor/MenuChangeAppLanguage.cs

@@ -13,6 +13,9 @@ public class MenuChangeAppLanguage
     static void ToCN() 
     {
         PlayerSettings.productName = CommonConfig.AppNames[0];
+        #if UNITY_IOS
+        PlayerSettings.SetApplicationIdentifier(BuildTargetGroup.iOS, "com.xmjssvr.BowArrow");
+        #endif
     }
 
     [MenuItem("APP语言版本切换/中文", true)]
@@ -26,6 +29,10 @@ public class MenuChangeAppLanguage
     static void ToEN() 
     {
         PlayerSettings.productName = CommonConfig.AppNames[1];
+        #if UNITY_IOS
+        PlayerSettings.productName = CommonConfig.AppNames[2];
+        PlayerSettings.SetApplicationIdentifier(BuildTargetGroup.iOS, "com.xmjssvr.BowArrowEn");
+        #endif
     }
 
     [MenuItem("APP语言版本切换/英文", true)]