public override void Initialize() { if (inited) { return; } BuildBaseComponents(); BuildLogicComponents(); // 载入翻译表 SCMText.LoadDict("translation", SCMText.dict); // 初始化所有模块 base.Initialize(); inited = true; }
static void TranslationPrepare() { tmp = (new GameObject("tmp")).AddComponent <Text>(); SCMText.LoadDict("translation", dict); var xa = GameObject.Find("Root").GetComponentInChildren <XAdapater>(); var doTranslation = !xa.DoTranslation; foreach (Transform c in GameObject.Find("Root").transform) { TranslationInChildren(c.gameObject, doTranslation); } DestroyImmediate(tmp.gameObject); tmp = null; xa.DoTranslation = doTranslation; Debug.Log("finished: " + (doTranslation ? "translated" : "untranslated")); AssetDatabase.SaveAssets(); }