Ver Fonte

调整翻译,单机名字。设置秒。连接页面等

slambb há 10 meses atrás
pai
commit
b44d333b78

+ 32 - 0
Assets/BowArrow/Resources/Prefabs/Views/Home/DeviceViewInfrared.prefab

@@ -353,6 +353,7 @@ GameObject:
   - component: {fileID: 5451191539135806006}
   - component: {fileID: 475354049885480237}
   - component: {fileID: 1909583778616930680}
+  - component: {fileID: 193730036012313611}
   m_Layer: 5
   m_Name: title
   m_TagString: Untagged
@@ -422,6 +423,21 @@ MonoBehaviour:
     m_VerticalOverflow: 1
     m_LineSpacing: 1
   m_Text: "\u672A\u8FDE\u63A5"
+--- !u!114 &193730036012313611
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 497525829943393009}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 0f4efe98aab6c6b41a7ee1f4c49df27b, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  textKey: Connect_BLE_NotConnected
+  layoutRebuildObject: {fileID: 0}
+  languageFontSizes: []
 --- !u!1 &932955428787593421
 GameObject:
   m_ObjectHideFlags: 0
@@ -7879,6 +7895,7 @@ GameObject:
   - component: {fileID: 8877235160740914775}
   - component: {fileID: 5218443512998239074}
   - component: {fileID: 7627441537867181464}
+  - component: {fileID: 704743712553910574}
   m_Layer: 5
   m_Name: title
   m_TagString: Untagged
@@ -7948,6 +7965,21 @@ MonoBehaviour:
     m_VerticalOverflow: 1
     m_LineSpacing: 1
   m_Text: "\u672A\u8FDE\u63A5"
+--- !u!114 &704743712553910574
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 8880125622615480549}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 0f4efe98aab6c6b41a7ee1f4c49df27b, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  textKey: Connect_BLE_NotConnected
+  layoutRebuildObject: {fileID: 0}
+  languageFontSizes: []
 --- !u!1 &9031970122640690138
 GameObject:
   m_ObjectHideFlags: 0

+ 8 - 1
Assets/BowArrow/Scripts/Components/TextAutoLanguage2/Resources/TextAutoLanguage2/cn.json

@@ -372,6 +372,10 @@
   "Mode_Globally": "联网对战",
   "Mode_Double": "双人游戏",
 
+  /**
+  玩家名字,通常单机情况下使用
+  **/
+  "Player_Name": "超级射手",
 
   /**
   匹配页面
@@ -401,6 +405,7 @@
   "Connect_BLE_Connected": "已连接",
   "Connect_BLE_Break": "断开连接",
   "Connect_BLE_None": "未知",
+  "Connect_BLE_NotConnected": "未连接",
 
   "Connect_Btn_Archery": "智能弓箭",
   "Connect_Btn_Gun": "智能手枪",
@@ -702,5 +707,7 @@
   "RemainingTime": "剩余时间{0}",
   "CoinsInfo": "币:{0}/{1}",
   "Seconds": "秒",
-  "Minutes": "分"
+  "Minutes": "分",
+  "Coin": "币"
+
 }

+ 8 - 1
Assets/BowArrow/Scripts/Components/TextAutoLanguage2/Resources/TextAutoLanguage2/en.json

@@ -421,6 +421,11 @@
   "Mode_Globally": "PLAY GLOBALLY",
   "Mode_Double": "DOUBLE PLAYER",
 
+  /**
+  玩家名字,通常单机情况下使用
+  **/
+  "Player_Name": "Super Shooter",
+
   /**
   匹配页面
   **/
@@ -449,6 +454,7 @@
   "Connect_BLE_Connected": "Connected",
   "Connect_BLE_Break": "Break",
   "Connect_BLE_None": "None",
+  "Connect_BLE_NotConnected": "Not Connected",
 
   "Connect_Btn_Archery": "Intelligent Archery",
   "Connect_Btn_Gun": "Intelligent Gun",
@@ -754,6 +760,7 @@
   "RemainingTime": "Remaining time {0}",
   "CoinsInfo": "Coins: {0}/{1}",
   "Seconds": "s",
-  "Minutes": "m "
+  "Minutes": "m ",
+  "Coin": "coin"
 
 }

+ 7 - 0
Assets/BowArrow/Scripts/Components/TextAutoLanguage2/TextAutoLanguage2.cs

@@ -16,6 +16,10 @@ public class TextAutoLanguage2 : MonoBehaviour
     [SerializeField] LanguageFontSize[] languageFontSizes = {};
 
     private static bool inited = false;
+
+    // 语言变更后的事件
+    public static event Action<LanguageEnum> OnLanguageChanged;
+
     public static void Init()
     {
         if (inited) return;
@@ -37,6 +41,9 @@ public class TextAutoLanguage2 : MonoBehaviour
                 textAutoLanguage.ApplyToText();    
             } catch (Exception e) { Debug.LogError(e.Message); }
         }
+
+        // 触发语言变更的事件
+        OnLanguageChanged?.Invoke(languageEnum);
     }
 
     public static LanguageEnum GetLanguage()

+ 7 - 0
Assets/BowArrow/Scripts/Network/UserPlayer.cs

@@ -111,6 +111,13 @@ public class UserPlayer : JCEntity
         {
             UserInfo userInfo = UserInfo.LoadLocal(0);
             if (userInfo == null) userInfo = new();
+            userInfo.nickname = TextAutoLanguage2.GetTextByKey("Player_Name");
+            TextAutoLanguage2.OnLanguageChanged += (languageEnum) =>
+            {
+                //切换单机的名字
+                userInfo.nickname = TextAutoLanguage2.GetTextByKey("Player_Name");
+                HomeView.ins.RenderNameOrGender();
+            };
             DoAfterGetUserInfo(userInfo);
             return;
         }

+ 3 - 1
Assets/SmartBow/Resources/SmartBow/Prefabs/Views/Home/SettingsView.prefab

@@ -4217,7 +4217,7 @@ RectTransform:
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 0}
   m_AnchorMax: {x: 1, y: 1}
-  m_AnchoredPosition: {x: -20.3, y: -36.6}
+  m_AnchoredPosition: {x: -20.300049, y: -36.599976}
   m_SizeDelta: {x: 0, y: 0}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!114 &3494904711726342550
@@ -20822,6 +20822,8 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 1f78bc6d95c85ec459f69837020b5f9f, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  inputCoinText: {fileID: 1478569246539731496}
+  inputSecondsText: {fileID: 8150949597801507088}
   inputCoin: {fileID: 8970520040795521614}
   inputSeconds: {fileID: 5696000878998691572}
 --- !u!1 &7131090606711037568

+ 15 - 0
Assets/SmartBow/Scripts/Views/SettingsViewParts/BoxBackStageManagement.cs

@@ -6,6 +6,8 @@ using UnityEngine.UI;
 
 public class BoxBackStageManagement : MonoBehaviour
 {
+    [SerializeField] Text inputCoinText;
+    [SerializeField] Text inputSecondsText;
     [SerializeField] InputField inputCoin;
     [SerializeField] InputField inputSeconds;
     int CoinMaxLimit = 10;// ¸ö
@@ -15,9 +17,21 @@ public class BoxBackStageManagement : MonoBehaviour
     {
         InitInputCoin();
         InitInputSeconds();
+
+        TextAutoLanguage2.OnLanguageChanged += HandleLanguageChange;
+    }
+    void OnDestroy()
+    {
+        TextAutoLanguage2.OnLanguageChanged -= HandleLanguageChange;
+    }
+    private void HandleLanguageChange(LanguageEnum newLanguage)
+    {
+        inputCoinText.text = "1-" + CoinMaxLimit + TextAutoLanguage2.GetTextByKey("Coin");
+        inputSecondsText.text = "1-" + SecondsMaxLimit + TextAutoLanguage2.GetTextByKey("Seconds");
     }
     void InitInputCoin()
     {
+        inputCoinText.text = "1-" + CoinMaxLimit + TextAutoLanguage2.GetTextByKey("Coin");
         inputCoin.text = UserSettings.ins.PerRoundCoin + "";
         UnityAction<string> onEndEdit_inputSize = (string str) => {
             inputCoin.SetTextWithoutNotify("");
@@ -41,6 +55,7 @@ public class BoxBackStageManagement : MonoBehaviour
     }
     void InitInputSeconds()
     {
+        inputSecondsText.text = "1-" + SecondsMaxLimit + TextAutoLanguage2.GetTextByKey("Seconds");
         inputSeconds.text = UserSettings.ins.PerRoundSeconds + "";
         UnityAction<string> onEndEdit_inputSize = (string str) => {
             inputSeconds.SetTextWithoutNotify("");