上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 41 下一页
摘要: 主要涉及到的类 看到最多的就是EventSystem这个自动添加的GameObject 代码阅读要点 1) 事件系统做了什么? 在Update中不断的检测这一帧发生的输入事件,并根据输入事件解析出当前在进行的操作。 所以,所有的逻辑都是在EventSystem.Update中发生的。Standalo 阅读全文
posted @ 2023-07-13 00:27 yanghui01 阅读(113) 评论(0) 推荐(1) 编辑
摘要: 主要的代码: public static readonly Vector2[] s_VertScratch = new Vector2[4]; public static readonly Vector2[] s_UVScratch = new Vector2[4]; private void Ge 阅读全文
posted @ 2023-07-05 01:40 yanghui01 阅读(130) 评论(0) 推荐(0) 编辑
摘要: function Test(num, nDigits) local multi = 10 ^ nDigits --10的n次方 local num1 = math.floor(num * multi) local ret = num1 / multi return ret end 百分比保留1位小数 阅读全文
posted @ 2023-07-02 23:21 yanghui01 阅读(7) 评论(0) 推荐(0) 编辑
摘要: #if UNITY_EDITOR using System; using System.IO; using UnityEditor; using UnityEngine; public static class SpriteTool { // OpenDirAfterExport const str 阅读全文
posted @ 2023-07-01 01:26 yanghui01 阅读(28) 评论(0) 推荐(0) 编辑
摘要: 最终效果,左侧为ugui的,右侧为自己实现的 using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class MyText : Graphic { public Font m_Font; 阅读全文
posted @ 2023-06-30 01:46 yanghui01 阅读(16) 评论(0) 推荐(0) 编辑
摘要: 效果,左侧为ugui的,右侧为自己实现的 using UnityEngine; using UnityEngine.UI; public class MyText : Graphic { public Font m_Font; public string m_Text = ""; public in 阅读全文
posted @ 2023-06-30 01:08 yanghui01 阅读(47) 评论(0) 推荐(0) 编辑
摘要: 最终效果 就简简单单一个利用Font把文本渲染出来 using UnityEngine; using UnityEngine.UI; public class MyText : Graphic { public Font m_Font; public string m_Text = "Hellow 阅读全文
posted @ 2023-06-29 01:46 yanghui01 阅读(26) 评论(0) 推荐(0) 编辑
摘要: Dynamic字符 1) ttf字体默认是Dynamic的,就是用到什么字符,运行时渲染对应的字符到字体贴图上 比如:Text组件上的New Text,在运行起来后字体贴图就渲染了NewText上去 2) 使用Font.GetCharacterInfo来获取字符信息 //不传fontSize参数, 阅读全文
posted @ 2023-06-29 01:36 yanghui01 阅读(191) 评论(0) 推荐(0) 编辑
摘要: string str = "abc key=\"hello\" key2=test key3= key4=\"\""; string pattern = @"(\S+)=""?([\w-.]+)""?"; //键值对正则表达式 MatchCollection result = Regex.Match 阅读全文
posted @ 2023-06-29 01:01 yanghui01 阅读(101) 评论(0) 推荐(0) 编辑
摘要: 最终效果 1) fnt文件上右击,执行命令 2) 空白位置右击,打开工具窗口生成fontsettings文件。 或者从菜单 -> Assets -> BMFont -> open BMFontTool打开 字体渲染中的几个术语 1) baseline, ascent, descent, Charac 阅读全文
posted @ 2023-06-29 00:51 yanghui01 阅读(417) 评论(0) 推荐(0) 编辑
上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 41 下一页