void createLang() { string fileNameWithoutExtension = newLang + "LocalizedText"; string fileName = fileNameWithoutExtension + ".json"; string filePath = ScriptableObjectConstant.FullLocalizedJsonFolder + fileName; JsonWrappingClass <LocalizationElement> jsonWrapper = new JsonWrappingClass <LocalizationElement>(newTexts.ToList()); string dataAsJson = JsonUtility.ToJson(jsonWrapper); File.WriteAllText(filePath, dataAsJson); localizationText.addLanguage(newLang, (Object)Resources.Load <Object>(ScriptableObjectConstant.ResourceLocalizedJsonFolder + fileNameWithoutExtension)); newLang = ""; newTexts = new LocalizationElement[0]; EditorGUI.FocusTextInControl(""); }