1234567891011121314151617181920212223242526272829303132333435363738394041 |
- using System.Collections;
- using System.Collections.Generic;
- using TMPro;
- using UnityEngine;
- using UnityEngine.UI;
- /* 本段代码控制登录页面语言设置
- */
- public class LoginLangController : MonoBehaviour
- {
- // Start is called before the first frame update
- void Start()
- {
- //login 场景canvas语言配置
- LoginCanvasLangSetting();
- }
- // Update is called once per frame
- //void Update()
- //{
-
- //}
- void LoginCanvasLangSetting()
- {
- //读取Login Canvas语言设定
- string textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "canvas", "login", "button", "login", EnviromentSetting.languageCode });
- GameObject.Find("Login Button").GetComponentInChildren<TextMeshProUGUI>().text = textValue;
- textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "canvas", "login", "button", "forget_password", EnviromentSetting.languageCode });
- GameObject.Find("Forget Password Button").GetComponentInChildren<TextMeshProUGUI>().text = textValue;
- textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "canvas", "login", "button", "quick_start", EnviromentSetting.languageCode });
- GameObject.Find("Quick Start Button").GetComponentInChildren<TextMeshProUGUI>().text = textValue;
- textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "canvas", "login", "label", "user_name", EnviromentSetting.languageCode });
- GameObject.Find("User Name").GetComponentInChildren<TextMeshProUGUI>().text = textValue;
- textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "canvas", "login", "label", "password", EnviromentSetting.languageCode });
- GameObject.Find("Password").GetComponentInChildren<TextMeshProUGUI>().text = textValue;
- textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "canvas", "login", "place_holder", "user_name", EnviromentSetting.languageCode });
- GameObject.Find("UserName Placeholder").GetComponentInChildren<TextMeshProUGUI>().text = textValue;
- textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "canvas", "login", "place_holder", "password", EnviromentSetting.languageCode });
- GameObject.Find("Password Placeholder").GetComponentInChildren<TextMeshProUGUI>().text = textValue;
- }
- }
|