随笔分类 -  Unity实用小功能

我们不敲代码,只是代码的搬运工。
摘要:通过计算该对象身上有多少个子对象来判断该对象是否有子对象,但需要主意的是,gameObj本身也会被记录到Length之中,所以在判断gameObj对象是否有子对象时,应做如下书写(而不是写成==0);void Start () {if (GetComponentsInChildren<Transfo 阅读全文
posted @ 2020-06-24 14:56 北特 阅读(1360) 评论(0) 推荐(0)
摘要:SystemInfo类中的静态变量: 中文显示:Rendering.CopyTextureSupport copyTextureSupport:(只读)支持多种复制纹理功能的情况。string deviceModel:(只读)设备型号(看到好多帖子都写的设备模型很让人误解)。string devic 阅读全文
posted @ 2020-05-11 10:13 北特 阅读(1141) 评论(0) 推荐(0)
摘要:Unity EventSystem Message System Input Modules Supported Events Raycasters 1. Message System(改进的消息系统) 基本上可以看成是以前SendMessage的升级版。 使用方法(照抄官网): step1. 声明 阅读全文
posted @ 2019-11-07 09:42 北特 阅读(508) 评论(0) 推荐(0)
摘要:1.普通射线检测(一般用于检测某一个物体) Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); Debug.DrawRay(ray.origin ,ray.direction , Color.red); RaycastHit hi 阅读全文
posted @ 2019-11-06 10:52 北特 阅读(4772) 评论(0) 推荐(0)