GenerateEditableFont() private method

private GenerateEditableFont ( string path ) : Font
path string
return UnityEngine.Font
        private static void CreateEditableCopy(MenuCommand command)
        {
            TrueTypeFontImporter trueTypeFontImporter = command.context as TrueTypeFontImporter;

            if (trueTypeFontImporter.fontTextureCase == FontTextureCase.Dynamic)
            {
                EditorUtility.DisplayDialog("Cannot generate editabled font asset for dynamic fonts", "Please reimport the font in a different mode.", "Ok");
                return;
            }
            string str = Path.GetDirectoryName(trueTypeFontImporter.assetPath) + "/" + Path.GetFileNameWithoutExtension(trueTypeFontImporter.assetPath);

            EditorGUIUtility.PingObject(trueTypeFontImporter.GenerateEditableFont(TrueTypeFontImporterInspector.GetUniquePath(str + "_copy", "fontsettings")));
        }
Ejemplo n.º 2
0
        private static void CreateEditableCopy(MenuCommand command)
        {
            TrueTypeFontImporter context = (TrueTypeFontImporter)command.context;

            if (context.fontTextureCase == FontTextureCase.Dynamic)
            {
                EditorUtility.DisplayDialog("Cannot generate editable font asset for dynamic fonts", "Please reimport the font in a different mode.", "Ok");
            }
            else
            {
                string str = Path.Combine(Path.GetDirectoryName(context.assetPath), Path.GetFileNameWithoutExtension(context.assetPath));
                EditorGUIUtility.PingObject(context.GenerateEditableFont(GetUniquePath(str + "_copy", "fontsettings")));
            }
        }