static void CreateFontSprite()
{
if (Selection.objects == null) return;
if (Selection.objects.Length == 0)
{
Debug.LogWarning("没有选中Sprite文件,需要将Sprite Mode设置成Multiple,切分好,并且以以名字的最后一个字符当做ascii码");
return;
}
string resoursePath = "Resources";
Object o = Selection.objects[0];
if (o.GetType() != typeof(Texture2D))
{
Debug.LogWarning("选中的并不是图片文件");
return;
}
string selectionPath = AssetDatabase.GetAssetPath(o);
if (selectionPath.Contains(resoursePath))
{
string selectionExt = Path.GetExtension(selectionPath);
if (selectionExt.Length == 0)
{
return;
}
string loadPath = selectionPath.Remove(selectionPath.Length - selectionExt.Length);
string fontPathName &
Unity创建字体
最新推荐文章于 2025-04-23 01:46:14 发布