public static bool CheckRebuildFont() { TextAsset selected = Selection.activeObject as TextAsset; if (selected == null) { return(false); } return(BFImporter.IsFnt(AssetDatabase.GetAssetPath(selected))); }
public static void RebuildAllFont() { string dataPath = Application.dataPath; int startPos = dataPath.Length - "Assets".Length; string[] files = Directory.GetFiles(Application.dataPath, "*.fnt", SearchOption.AllDirectories); for (int i = 0; i < files.Length; i++) { BFImporter.DoImportBitmapFont(files[i].Substring(startPos)); } }
public static void BuildFont() { TextAsset selected = Selection.activeObject as TextAsset; string path = AssetDatabase.GetAssetPath(selected); bool isConfig = path.EndsWith(".fnt", StringComparison.OrdinalIgnoreCase); isConfig = path.EndsWith(".txt", StringComparison.OrdinalIgnoreCase);//忽略大小比较 if (selected != null && isConfig) { BFImporter.DoImportBitmapFont(path); } else { Debug.LogError("未选择.fnt【.txt修改而来】文件,支持配置文件数据xml 和txt"); } }
public static bool CheckRebuildFont() { if (EditorApplication.isPlaying) { return(false); } TextAsset selected = Selection.activeObject as TextAsset; if (selected == null) { return(false); } string path = AssetDatabase.GetAssetPath(selected); return(BFImporter.CanImportFnt(path)); }
public static void RebuildAllFont() { string dataPath = Application.dataPath; int startPos = dataPath.Length - "Assets".Length; //*.fnt 保证了后缀的唯一性 string[] files = Directory.GetFiles(Application.dataPath, "*.fnt", SearchOption.AllDirectories); for (int i = 0; i < files.Length; i++) { string path = files[i].Substring(startPos); if (!BFImporter.IsFnt(path)) { continue; } BFImporter.DoImportBitmapFont(path); } }
public static void RebuildFont() { TextAsset selected = Selection.activeObject as TextAsset; BFImporter.DoImportBitmapFont(AssetDatabase.GetAssetPath(selected)); }