private void showTerm(I18nDB.Term obj) { EditorGUILayout.BeginVertical("box"); obj.name = GUILayout.TextField(obj.name); selectLang(obj); new List <I18nDB.TermLang>(obj.termLangs).ForEach(tl => showLangTerm(obj, tl)); EditorGUILayout.EndVertical(); }
private void showLangTerm(I18nDB.Term rootObj, I18nDB.TermLang obj) { EditorGUILayout.BeginHorizontal("box"); obj.value = EditorGUILayout.TextField(obj.language.ToString(), obj.value); if (GUILayout.Button("DEL")) { rootObj.termLangs.Remove(obj); } EditorGUILayout.EndHorizontal(); }
private void selectLang(I18nDB.Term obj) { List <SystemLanguage> sls = EnumHelper.ToList <SystemLanguage>(); sls = sls.FindAll(s => !obj.termLangs.Exists(tl => tl.language == s)); int idx = EditorUtils.popupList("Add Lang", sls.ConvertAll(s => s.ToString()), s => s); if (idx >= 0) { obj.termLangs.Add(new I18nDB.TermLang(sls[idx])); } }