随笔分类 -  100-Unity / 102-UnityCommon

Unity中常用工具类或功能实现
摘要:using UnityEngine; using System.Collections; //控制有放缩弹一弹的效果 public class ScaleController : MonoBehaviour { bool ismax = false; public float scaleSpeed 阅读全文
posted @ 2024-05-22 14:23 weigang 阅读(21) 评论(0) 推荐(0) 编辑
摘要:IEnumeratorTool using System; using System.Collections; using System.Collections.Generic; using UnityEngine; public class IEnumeratorTool : MonoBehavi 阅读全文
posted @ 2024-05-22 14:14 weigang 阅读(23) 评论(0) 推荐(0) 编辑
摘要:通过给UI或物体挂载下面脚本,来设置层级 using UnityEngine; using System.Collections; using UnityEngine.UI; namespace Common { //设置UI和render的层级 public class UIDepth : Mon 阅读全文
posted @ 2024-05-22 09:44 weigang 阅读(274) 评论(0) 推荐(0) 编辑
摘要:using DG.Tweening; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using Utils; //挂在UI上面 public c 阅读全文
posted @ 2024-05-21 15:06 weigang 阅读(98) 评论(0) 推荐(0) 编辑
摘要:Timer和TimerManager代码 using System.Collections; using UnityEngine; public class Timer : MonoBehaviour { public delegate void Notifier(); public Notifie 阅读全文
posted @ 2024-05-21 15:03 weigang 阅读(187) 评论(0) 推荐(0) 编辑
摘要:Unity项目中添加UniRx插件 插件下载:https://files.cnblogs.com/files/weigangblog/UniRx.zip 工具类代码: using System; using UniRx; using UnityEngine; public static class 阅读全文
posted @ 2021-02-25 16:35 weigang 阅读(742) 评论(0) 推荐(0) 编辑
摘要:Unity的Text组件的文字不会像word之类的自动处理首字符是符号的段落文字,会出现下面的,一行文字第一个字符是符号,这样不美观不合适。 Text赋值之后,使用IList<UILineInfo>取出文字的行内容,使用正则表达式,比较第一个字符是否是符号,如果是符号,在符号前一个字符之前插入回车, 阅读全文
posted @ 2021-02-04 10:10 weigang 阅读(1206) 评论(0) 推荐(0) 编辑
摘要:UGUI的Text自己是没有下划线或者文字中间的划去横线的。使用此组件,选择Text和划线类型: 1.设置autoLink=true,运行后自动克隆相同的文本组件,计算文字长度,给克隆的Text填充"_"或者"-"; 2.调用CreateLink方法,为指定Text文本添加下划线 3.此组件暂时用于 阅读全文
posted @ 2021-01-27 11:06 weigang 阅读(5578) 评论(0) 推荐(0) 编辑
摘要:使用QrCode脚本插件 插件链接 https://files.cnblogs.com/files/weigangblog/QRCode.zip 简单的帮助类代码如下: using UnityEngine; using ZXing; using ZXing.QrCode; // 二维码 public 阅读全文
posted @ 2020-04-20 16:18 weigang 阅读(654) 评论(0) 推荐(0) 编辑
摘要:C#使用字符串校验18位身份证号有效性的方法: 1.校验规则(原理): 18位身份证号的组成: ddddddyyyymmddxxsP共18位,其中包含:6位地址编码+8位出生日期+3位顺序号+1位校验位; 校验方法: (1)前17位数字加权求和,公式: S=Sum(Ai*Wi),i=0,1,..., 阅读全文
posted @ 2020-04-20 16:01 weigang 阅读(495) 评论(0) 推荐(0) 编辑
摘要:下方链接是一个需要过滤的敏感词汇的txt文件,可根据需要自行编辑。 https://files.cnblogs.com/files/weigangblog/SensitiveWords1.zip 这里是将txt文件放在StreamingAssets文件夹中,FilterHelp在启动之后加载使用,使 阅读全文
posted @ 2020-04-19 10:59 weigang 阅读(846) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示