using System.Collections; using System.Collections.Generic; using UnityEngine; public class PengZhuang : MonoBehaviour { public int lingLi = 100; System.Timers.Timer timer = new System.Timers.Timer(); private bool isStay = true; // Use this for initi…
第一次看到LayerMask根本不知道是什么东东,后来问问度娘,看了几篇文章,终于看明白一点点,在网上看到各路大神的解释,终于明白了,LayerMask实际上是一个位码操作,在Unity3d中Layers一共有32层,这个是不能增加或者减少的,中文名字叫层蒙版 LayerMask允许你在检视面板中显示LayerMask弹出菜单,类似与camera.cullingmask.LayerMask可以选择性地过滤物体,例如当投射射线时 摘自官网:Layers are used throughout Un…
可选是否打开矩阵变换,支持xyz三种朝向 using UnityEngine; using System.Collections; using System.Collections.Generic; public class CapsuleDetection : MonoBehaviour { public enum Axis { X, Y, Z } public Transform comparePointTransform; public float radius; public float…
转自:http://angryant.com/2014/03/07/Moving-in-Unity/ ,详细描述了物体在unity中移动的几种方式,并且给出了代码描述,对加深对Unity理解很有帮助,谢谢AngryAnt .我用我粗陋的英文水平进行简单的翻译,望谅解. Introduction Moving something around on the screen in Unity is really not that hard. The point of this post is ther…