1 2 3 4 5 ··· 24 下一页
摘要: using UnityEngine; using UnityEditor; public enum Language { None, Chinese, Korean, Japanese, } public class LanguageMenu { static Language mLanguage 阅读全文
posted @ 2025-06-30 20:52 小·糊涂仙 阅读(15) 评论(0) 推荐(0)
摘要: 在unity的开发过程中,有时候会出现这样的需求,自定义的组件中存在public字段,但是又不想开放给非程序组的同学编辑,为了防止其误操作,需要将字段设置成只读状态,如上图中的TestValue01字段。 当然,可以通过给每个组件自定义Inspector实现这样的需求,但是这样做怎么想都感觉不是太合 阅读全文
posted @ 2025-06-29 17:25 小·糊涂仙 阅读(39) 评论(0) 推荐(0)
摘要: 最近在使用的Cursor编写Unity代码的过程中,好好的Cursor突然不能跳转到类、方法、变量的定义了,总是提示 “XXX未定义”之类的错误。 于是,开始了长达两三个小时的各种尝试:cursor中的各种插件禁用后重启、Regenerate project files、回退本地改动等等,总之能尝试 阅读全文
posted @ 2025-06-28 22:00 小·糊涂仙 阅读(4167) 评论(0) 推荐(0)
摘要: 直接上代码: 1 using System; 2 3 4 class ToolUtils 5 { 6 /// <summary> 7 /// 余式表定义 8 /// </summary> 9 static ushort[] crc16tab = new ushort[256] { 10 0x0000 阅读全文
posted @ 2022-02-11 20:08 小·糊涂仙 阅读(244) 评论(0) 推荐(0)
摘要: 今天偶然发现一个问题——字符串字节获取的方式不同会导致获取的结果不一样。 定义如下方法,用于获取字符串的字节: 1 static byte[] GetBytes(string data) 2 { 3 using (MemoryStream ms = new MemoryStream()) 4 { 5 阅读全文
posted @ 2022-02-11 19:50 小·糊涂仙 阅读(1277) 评论(0) 推荐(0)
摘要: 加密解密的核心代码: 1 using System; 2 using System.IO; 3 using System.Security.Cryptography; 4 using System.Text; 5 6 public class AESChiper 7 { 8 /// <summary 阅读全文
posted @ 2022-02-11 15:14 小·糊涂仙 阅读(208) 评论(0) 推荐(0)
摘要: 1 static void Main(string[] args) 2 { 3 //当前工作目录 4 Console.WriteLine($"CurrentDirectory = {Environment.CurrentDirectory}"); 5 6 //原始名字 7 string oldFul 阅读全文
posted @ 2022-01-30 12:07 小·糊涂仙 阅读(80) 评论(0) 推荐(0)
摘要: 1. IPv6.m和 IPv6.h 放到 Plugins/IOS下 2.创建Socket,代码如下: 1 using UnityEngine; 2 using System; 3 using System.Collections; 4 using System.Net; 5 using System 阅读全文
posted @ 2022-01-29 12:55 小·糊涂仙 阅读(696) 评论(0) 推荐(0)
摘要: 首先明确两个概念: Screen.currentResolution - 指的是设备分辨率,比如:电脑上指的就是电脑的屏幕分辨率,手机上指的就是手机的屏幕分辨率。 Screen.width,Screen.height - 指的是使用该值的窗口的宽高,比如:在Scene窗口使用指的就是Scene窗口的 阅读全文
posted @ 2022-01-25 13:26 小·糊涂仙 阅读(10051) 评论(0) 推荐(0)
摘要: 定义类的共同接口: 1 interface IScene 2 { 3 } 定义几个测试类: 1 public class LoginScene : IScene 2 { 3 } 4 5 public class MainScene : IScene 6 { 7 8 } 定义枚举(注意,枚举名字需要和 阅读全文
posted @ 2021-10-29 12:15 小·糊涂仙 阅读(67) 评论(0) 推荐(0)
1 2 3 4 5 ··· 24 下一页