摘要: using System; using System.Reflection; using System.Linq; public class BaseClass { } public class DerivedClass1 : BaseClass { } public class DerivedCl 阅读全文
posted @ 2024-04-25 11:52 gatran 阅读(0) 评论(0) 推荐(0) 编辑
摘要: public int GetScoreByIndex(int index) { return examinationDatas.Find(x => x.index == index).actualScore; } 阅读全文
posted @ 2024-04-24 19:14 gatran 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 串口通信 在对串口进行编程时候,我们要向串口发送指令,然后我们解析串口返回的指令。从.NET Framework 2.0开始,C#提供了SerialPort类用于实现串口控制。命名空间:System.IO.Ports。 1、 常用的字段:PortName:获取或设置通信端口BaudRate:获取或设 阅读全文
posted @ 2024-03-27 14:43 gatran 阅读(1) 评论(0) 推荐(0) 编辑
摘要: DOTween路径动画 代码如下: using DG.Tweening; using DG.Tweening.Core; using DG.Tweening.Plugins.Core.PathCore; using DG.Tweening.Plugins.Options; using UnityEn 阅读全文
posted @ 2024-02-28 17:36 gatran 阅读(10) 评论(0) 推荐(0) 编辑
摘要: 编辑器扩展 using UnityEditor; using UnityEngine; public class Bolive : Editor//要继承Editor脚本 { //脚本要放在Editor文件夹中 [MenuItem("Ques/Muse", false, 10)]//第一个参数是目录 阅读全文
posted @ 2024-02-04 17:06 gatran 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 加载场景不销毁物体 挂在不想销毁的物体上 using UnityEngine; public class DontDestroyObject : MonoBehaviour { private static DontDestroyObject instance; private void Awake 阅读全文
posted @ 2023-11-20 20:11 gatran 阅读(3) 评论(0) 推荐(0) 编辑
摘要: string字符串操作 using System; using System.Linq; using UnityEngine; public class Guse : MonoBehaviour { void Start() { string str = "ASc_b1 6U2ja"; string 阅读全文
posted @ 2023-09-28 10:16 gatran 阅读(8) 评论(0) 推荐(0) 编辑
摘要: WPS Word删除空白行 1.点击查找替换 2.查找内容输入:^p^p 3.替换为框输入:^p 4.点击全部替换 阅读全文
posted @ 2023-09-25 10:41 gatran 阅读(48) 评论(0) 推荐(0) 编辑
摘要: C#中?的相关使用 1. 可空类型 使用后可以使值类型的变量,既可以接收null也可以接收正常的值类型。 int? a = null; a = 10; 2. 可空运算符 使用?前: if(object != null){//方法调用 object.method(); } if(array != nu 阅读全文
posted @ 2023-08-24 20:17 gatran 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 特殊字符 1、首行缩进两个字符 txt.text=“\u3000\u3000” + str; 2、首行缩进两个字符 将输入法换成全角的,在Text属性面板中添加空格即可。 3、换行 “\n” 阅读全文
posted @ 2023-08-04 18:34 gatran 阅读(9) 评论(0) 推荐(0) 编辑