摘要:
这个仅仅是修改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 阅读全文
摘要:
原理 泛光其实就是让图片变亮,看着有种自身在发光的感觉。 那怎么做呢?简单点,就是图片模糊处理后,再与原来的颜色值相加,就能使整体颜色变亮,但直接这样做可能会让颜色太亮而过曝,所以可以在图片模糊前做下颜色值的控制,防止相加后直接成为白色。 效果 c#代码 using UnityEngine; pub 阅读全文