摘要: 曲线在unity下如何绘制? 类似绘制圆,是用一段一段的线段拼接来模拟的,这边也是类似,可以用一段一段的线段来模拟曲线。 既然要模拟,那我们也得知道贝塞尔曲线的公式才行。 一般用的比较多的就是3次贝塞尔曲线,该曲线由起点p1,p1的控制点c1,终点p2,p2的控制点c2组成。 公式为:p = p1* 阅读全文
posted @ 2024-07-28 23:46 yanghui01 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 1秒=1000毫秒 1毫秒=1000微秒 1微秒=1000纳秒 1Tick=100纳秒 1微妙=10Tick 1毫秒=1000微妙=1000*10Tick 1秒=1000毫秒=1000*1000*10Tick long shanghaiTimeZoneTicks = 8 * 36000000000; 阅读全文
posted @ 2024-07-28 13:56 yanghui01 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 遍历可变参数 local function Test1(...) local argCnt = select("#", ...) for i=1,argCnt do local item = select(i, ...) print(i, item) end end Test1(4, 5, 6) 遍 阅读全文
posted @ 2024-07-28 13:38 yanghui01 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 效果 就是第1行绘制了一个工具栏,高度为17; 然后绘制了一个窗口分隔条,左侧用于放轨道,右侧用于放轨道片段,分隔条可以在一定范围内拖动。 public class MyTimelineWnd : EditorWindow { [MenuItem("MyTools/MyTimelineWnd", f 阅读全文
posted @ 2024-05-23 00:34 yanghui01 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 用途:列出动画的第1帧与预制体GameObject当前值不同的,需要同步的可以手动同步 效果图 public struct ValueNotSameItem { public EditorCurveBinding curveBinding; //关联参数 public AnimationCurve 阅读全文
posted @ 2024-05-20 23:06 yanghui01 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 效果图 用途:界面动效已经由动效同事做完(假设k了100帧),然后UI同事又把一些节点的位置做了10px的调整。此时一帧一帧去手动改,费事费力还可能出错。 这个工具的用途就是:对相关节点的所有关键帧批量做偏移。 public class AnimClipEditWnd : EditorWindow 阅读全文
posted @ 2024-05-18 00:12 yanghui01 阅读(3) 评论(0) 推荐(0) 编辑
摘要: public static float TrimFloat(float f) { int i = (int)(f * 1000); float result = i / 1000.0f; return result; } public static AnimationCurve CloneAnimC 阅读全文
posted @ 2024-05-17 23:07 yanghui01 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 1,关键帧数据都保存在AnimationCurve上,所以首先要获取到这个 public static AnimationCurve GetAnimCurve(AnimationClip clip, string path, string propName) { EditorCurveBinding 阅读全文
posted @ 2024-05-17 23:06 yanghui01 阅读(3) 评论(0) 推荐(0) 编辑
摘要: Bevel:斜面效果 Type: Outer Bevel: 外斜面,从边缘向上凸,当中平的; Inner Bevel: 内斜面,从斜面开始绘制位置向下凹 amount: 斜面明显程度,默认0.5 对于三,它的斜面宽度差不多是字符笔画宽度的0.26,当把width设置成-0.23时,就可以看到斜面的开 阅读全文
posted @ 2024-05-14 23:12 yanghui01 阅读(14) 评论(0) 推荐(0) 编辑
摘要: 有点类似photoshop中的图层样式,利用好也能制作出不错的艺术字效果。 Face: 文字外观 color: 文字颜色 softness: 羽化程度 dilate: 外扩(变粗)或内收(变细) Texture: 贴图填充在字形内 Speed X: 贴图在x方向移动 Outline: 居中描边 co 阅读全文
posted @ 2024-05-14 23:12 yanghui01 阅读(394) 评论(0) 推荐(0) 编辑