using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using TMPro; public class TRANS : MonoBehaviour { public static string This(string txt) { int ind = System.Array.IndexOf(_T.TRANS, txt); string t = _T.TRANS[ind + _G.L]; return t; } public static void go() { trans("txt", ""); trans("txt_pro", "pro"); trans("CT2", ""); trans("txt", ""); trans("CT1", ""); trans("CTP1", "pro"); trans("CTP2", "pro"); } public static void trans(string Tag, string P){ //print("P==="+P+" tag==="+Tag); GameObject[] gos; gos = GameObject.FindGameObjectsWithTag(Tag); int ind = 1; foreach (GameObject go in gos) { if (go.name != "") { ind = System.Array.IndexOf(_T.TRANS, go.name); if(P=="pro")go.gameObject.GetComponent().text = _T.TRANS[ind + _G.L]; else go.gameObject.GetComponent().text = _T.TRANS[ind + _G.L]; } } } }