Пример #1
0
        public override void OnInspectorGUI()
        {
            if (preKey != textMeshPro.Key || preFile != textMeshPro.FileName)
            {
                LanguageMgr.LoadModule(textMeshPro.FileName);
                textMeshPro.GetStringAndSetText(textMeshPro.Key, textMeshPro.FileName);
                preKey  = textMeshPro.Key;
                preFile = textMeshPro.FileName;
            }

            textMeshPro.Key      = EditorGUILayout.TextField("Key ID", textMeshPro.Key);
            textMeshPro.FileName = (LanguageMgr.FileNames)EditorGUILayout.EnumPopup("File Name", textMeshPro.FileName);

            if (preLanguage != textMeshPro.ChooseLanguage)
            {
                LanguageMgr.instance.MLang = textMeshPro.ChooseLanguage;
                LanguageMgr.instance.Init();
                LanguageMgr.LoadModule(textMeshPro.FileName);
                textMeshPro.GetStringAndSetText(textMeshPro.Key, textMeshPro.FileName);
                preLanguage = textMeshPro.ChooseLanguage;
            }
            textMeshPro.ChooseLanguage = EditorGUILayout.Popup("Language", textMeshPro.ChooseLanguage, LanguageMgr.instance.LanguageList);

            EditorGUILayout.PropertyField(materialProp);
            if (materialProp.objectReferenceValue != textMeshPro.SpecificMaterial)
            {
                serializedObject.ApplyModifiedProperties();
                textMeshPro.SetMultiLanguageMaterial();
            }

            base.OnInspectorGUI();
        }
Пример #2
0
        public override void OnInspectorGUI()
        {
            MultiMeshText multitext = target as MultiMeshText;

            if (preKey != multitext.Key || preFile != multitext.FileName)
            {
                LanguageMgr.LoadModule(multitext.FileName);
                multitext.text = multitext.GetStringAndSetText();
                preKey         = multitext.Key;
                preFile        = multitext.FileName;
            }
            multitext.Key      = EditorGUILayout.TextField("Key ID : ", multitext.Key);
            multitext.FileName = (LanguageMgr.FileNames)EditorGUILayout.EnumPopup("File Name : ", multitext.FileName);

            if (preLanguage != multitext.ChooseLanguage)
            {
                LanguageMgr.instance.MLang = multitext.ChooseLanguage;
                LanguageMgr.instance.Init();
                LanguageMgr.LoadModule(multitext.FileName);
                multitext.text = multitext.GetStringAndSetText();
                preLanguage    = multitext.ChooseLanguage;
            }
            multitext.ChooseLanguage = EditorGUILayout.Popup(multitext.ChooseLanguage, LanguageMgr.instance.LanguageList);
        }