上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 47 下一页
摘要: 两个列表是否相同 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 阅读(86) 评论(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 阅读(203) 评论(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 阅读(95) 评论(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)
摘要: 原理 先抓取整个屏幕画面到RenderTexture1上,然后把左边一半复制到RenderTexture2,右边一半复制到RenderTexture3 效果 c#代码 using UnityEngine; using UnityEngine.Rendering; [RequireComponent( 阅读全文
posted @ 2024-03-28 22:47 yanghui01 阅读(69) 评论(0) 推荐(0)
摘要: 存放了贴图大小的数据,有4个值,分别是:1/width, 1/height, width, height 我们直接在shader中读就可以,Unity内部会帮我们初始化好 阅读全文
posted @ 2024-03-28 22:09 yanghui01 阅读(188) 评论(0) 推荐(0)
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 47 下一页