上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 47 下一页
摘要: fnt文件生成unity字体的原理其实就是渲染图集Atlas上的Sprite,这边直接利用Unity自带的图集工具生成fnt文件 注意:这里生成的fnt文件还没法直接用,因为没有关联字符,这个工具只是第1步,第2步要用Fnt编辑工具关联字符:Fnt文件编辑工具 效果 public class Spr 阅读全文
posted @ 2024-04-29 22:17 yanghui01 阅读(308) 评论(0) 推荐(0)
摘要: public class SpriteAtlasExportTool : EditorWindow { const string MenuItemPath_ExportSelectSpriteAtlas = "MyTools/Export Select SpriteAtlas"; [MenuItem 阅读全文
posted @ 2024-04-28 22:54 yanghui01 阅读(168) 评论(0) 推荐(0)
摘要: 两个列表是否相同 function IsTwoListValueSame(list1, list2) local cnt1 = #list1 local cnt2 = #list2 if cnt1 ~= cnt2 then return false end local tab = {} local 阅读全文
posted @ 2024-04-20 23:16 yanghui01 阅读(25) 评论(0) 推荐(0)
摘要: 枚举 public enum MyFontStyleMask { Bold = 1, Italic = 1 << 1, Outline = 1 << 2, } //枚举转int { int a = (int)MyFontStyleMask.Italic; int b = Convert.ToInt3 阅读全文
posted @ 2024-04-14 00:25 yanghui01 阅读(87) 评论(0) 推荐(0)
摘要: 删除所有匹配的元素 function RemoveMatchItems(list, matchFunc) local removeCt = 0 local ct = #list local i = 1 while i <= ct do if matchFunc(list[i]) then table 阅读全文
posted @ 2024-04-13 23:12 yanghui01 阅读(20) 评论(0) 推荐(0)
摘要: 效果 枚举 public enum MyFontStyleMask { Bold = 1, Italic = 1 << 1, Outline = 1 << 2, } 标签类 using UnityEngine; public class MyEnumMaskAttribute : PropertyA 阅读全文
posted @ 2024-04-12 22:15 yanghui01 阅读(204) 评论(0) 推荐(0)
摘要: 效果 枚举 public enum MyFontStyle { Bold, Italic, Outline, } public enum MyFontStyleMask { Bold = 1, Italic = 1 << 1, Outline = 1 << 2, } 标签类 using UnityE 阅读全文
posted @ 2024-04-12 22:06 yanghui01 阅读(96) 评论(0) 推荐(0)
摘要: 原理 泛光其实就是让图片变亮,看着有种自身在发光的感觉。 那怎么做呢?简单点,就是图片模糊处理后,再与原来的颜色值相加,就能使整体颜色变亮,但直接这样做可能会让颜色太亮而过曝,所以可以在图片模糊前做下颜色值的控制,防止相加后直接成为白色。 效果 c#代码 using UnityEngine; pub 阅读全文
posted @ 2024-03-29 22:36 yanghui01 阅读(133) 评论(0) 推荐(0)
摘要: 原理 采样5x5范围的像素(即25个像素),然后按中间往外减少的权重值,计算出最终颜色值。 效果 c#代码 using UnityEngine; public class GaussianBlurEff : MonoBehaviour { public Shader m_Shader; public 阅读全文
posted @ 2024-03-29 21:58 yanghui01 阅读(63) 评论(0) 推荐(0)
摘要: 原理 就是取自身以及该像素周围的8个像素的颜色值相加,然后除9取个平均值,得到最终颜色值 效果 因为模糊后会出现一些方形的像素效果,模糊效果不是很平均,所以均值模糊也叫做盒状模糊。 c#代码 using UnityEngine; public class BoxBlurEff : MonoBehav 阅读全文
posted @ 2024-03-28 23:24 yanghui01 阅读(68) 评论(0) 推荐(0)
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 47 下一页