04 2024 档案
摘要:已经有ugui Text了,为什么还要再来个TextMeshPro? 1) TextMeshPro使用了更先进的渲染技术,渲染效果更好。 同样的36号斜体字在Scene窗口中,我们放大后,Text可以明显的看到锯齿,而TextMeshPro字体的边缘还是圆润光滑。 2) TextMeshPro默认支
阅读全文
摘要:这个仅仅是修改fnt,不负责从fnt生成unity字体文件。 fnt生成字体文件看这边:ugui位图字体使用 - fnt生成fontsettings工具 效果 工具代码 public class FntEditTool : EditorWindow { [MenuItem("MyTools/Fnt
阅读全文
摘要:c#自带函数 //字符 -> charCode int charCode = char.ConvertToUtf32(str, 0); //charCode -> 字符 string ch = char.ConvertFromUtf32(charCode); 自己实现:字符 -> charCode
阅读全文
摘要:fnt文件生成unity字体的原理其实就是渲染图集Atlas上的Sprite,这边直接利用Unity自带的图集工具生成fnt文件 注意:这里生成的fnt文件还没法直接用,因为没有关联字符,这个工具只是第1步,第2步要用Fnt编辑工具关联字符:Fnt文件编辑工具 效果 public class Spr
阅读全文
摘要:public class SpriteAtlasExportTool : EditorWindow { const string MenuItemPath_ExportSelectSpriteAtlas = "MyTools/Export Select SpriteAtlas"; [MenuItem
阅读全文
摘要:两个列表是否相同 function IsTwoListValueSame(list1, list2) local cnt1 = #list1 local cnt2 = #list2 if cnt1 ~= cnt2 then return false end local tab = {} local
阅读全文
摘要:枚举 public enum MyFontStyleMask { Bold = 1, Italic = 1 << 1, Outline = 1 << 2, } //枚举转int { int a = (int)MyFontStyleMask.Italic; int b = Convert.ToInt3
阅读全文
摘要:删除所有匹配的元素 function RemoveMatchItems(list, matchFunc) local removeCt = 0 local ct = #list local i = 1 while i <= ct do if matchFunc(list[i]) then table
阅读全文
摘要:效果 枚举 public enum MyFontStyleMask { Bold = 1, Italic = 1 << 1, Outline = 1 << 2, } 标签类 using UnityEngine; public class MyEnumMaskAttribute : PropertyA
阅读全文
摘要:效果 枚举 public enum MyFontStyle { Bold, Italic, Outline, } public enum MyFontStyleMask { Bold = 1, Italic = 1 << 1, Outline = 1 << 2, } 标签类 using UnityE
阅读全文

浙公网安备 33010602011771号