public override void OnGUI() { IMGUILayout.Header("PLIST VALUES"); foreach (var plistKey in XCodeProjectSettings.Instance.PlistVariables) { EditorGUILayout.BeginVertical(GUI.skin.box); DrawPlistVariable(plistKey, plistKey, XCodeProjectSettings.Instance.PlistVariables); EditorGUILayout.EndVertical(); if (!XCodeProjectSettings.Instance.PlistVariables.Contains(plistKey)) { return; } } EditorGUILayout.Space(); EditorGUILayout.BeginVertical(GUI.skin.box); EditorGUILayout.BeginHorizontal(); EditorGUILayout.PrefixLabel("New Variable Name"); s_NewPlistValueName = EditorGUILayout.TextField(s_NewPlistValueName); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.Space(); if (GUILayout.Button("Add", GUILayout.Width(100))) { if (s_NewPlistValueName.Length > 0) { var v = new InfoPlistKey(); v.Name = s_NewPlistValueName; XCodeProject.SetInfoPlistKey(v); } s_NewPlistValueName = string.Empty; } EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); EditorGUILayout.EndVertical(); }
static void RegisterAppLanguages() { //We have nothing to register, no point to add en empty CFBundleLocalizations key. if (XCodeProjectSettings.Instance.Languages.Count == 0) { return; } var cfBundleLocalizations = new InfoPlistKey(); cfBundleLocalizations.Name = XCodeProjectSettings.CfLocalizationsPlistKey; cfBundleLocalizations.Type = InfoPlistKeyType.Array; foreach (var lang in XCodeProjectSettings.Instance.Languages) { var langItem = new InfoPlistKey(); langItem.Type = InfoPlistKeyType.String; langItem.StringValue = lang.Name; cfBundleLocalizations.AddChild(langItem); } XCodeProject.SetInfoPlistKey(cfBundleLocalizations); }