/// <summary> /// Copie les polices d'une autre police /// </summary> /// <param name="name">nom de la police à créer</param> /// <param name="copiedFont">police à copier</param> private static void CopyFont(string name, FontsEnum copiedFont) { foreach (LanguagesEnum lang in Enum.GetValues(typeof(LanguagesEnum))) { if (System.IO.Directory.Exists("Assets/Resources/Lang/Fonts/" + lang.ToString())) { if (System.IO.File.Exists("Assets/Resources/Lang/Fonts/" + lang.ToString() + "/" + copiedFont.ToString() + ".ttf")) { System.IO.File.Copy("Assets/Resources/Lang/Fonts/" + lang.ToString() + "/" + copiedFont.ToString() + ".ttf", "Assets/Resources/Lang/Fonts/" + lang.ToString() + "/" + name + ".ttf"); } if (System.IO.File.Exists("Assets/Resources/Lang/Fonts/" + lang.ToString() + "/" + copiedFont.ToString() + ".dfont")) { System.IO.File.Copy("Assets/Resources/Lang/Fonts/" + lang.ToString() + "/" + copiedFont.ToString() + ".dfont", "Assets/Resources/Lang/Fonts/" + lang.ToString() + "/" + name + ".dfont"); } if (System.IO.File.Exists("Assets/Resources/Lang/Fonts/" + lang.ToString() + "/" + copiedFont.ToString() + ".otf")) { System.IO.File.Copy("Assets/Resources/Lang/Fonts/" + lang.ToString() + "/" + copiedFont.ToString() + ".otf", "Assets/Resources/Lang/Fonts/" + lang.ToString() + "/" + name + ".otf"); } } } AssetDatabase.Refresh(); }
private Font LoadFont(FontsEnum font, LanguagesEnum lang) { return(Resources.Load <Font>("Lang/Fonts/" + lang.ToString() + "/" + font.ToString())); }