Beispiel #1
0
        public static bool CheckRebuildFont()
        {
            TextAsset selected = Selection.activeObject as TextAsset;

            if (selected == null)
            {
                return(false);
            }
            return(BFImporter.IsFnt(AssetDatabase.GetAssetPath(selected)));
        }
Beispiel #2
0
        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);
            }
        }