U3D中C#编程的接口列表
接口 | 列表 |
---|---|
transform.translate(0,0,verValue) | 移动 |
transform.Rotate(0,horValue,0) | 旋转 |
float F1 = Vector3.Cross(V1,V2) | 两个向量的叉乘 |
float V1Value = Vector3.Magnitude(V1)= V1.magnitude | 求V1向量的长度 |
float jiaodu = Vector3.Angle(V1,V2) | 求两个向量的夹角 |
float sinValue = Mathf.Sin( jiaodu * Mathf.Deg2Rad ) | sin值,不过参数要用弧度值 |
Vector3 result = Vector3.Lerp(a, b, t); | 返回a和b两个向量的中间向量,其中a,b均为Vector3向量,t是最大移动距离 |
transform.position = Vector3.SmoothDamp(transform.position,ref ,smoothTime) | GO向另外一个GO平滑移动 |
float distance = Vector3.Distance(cubeVector,sphereVector); | 求两个向量之间的距离 |
Rigidbody body = copyBall.GetComponent(); | 获取其rigidbody |
Destroy(copyBall,4); | 销毁对象 |
body.AddForce(fireTransform.forward * 7000); | 力和运动 |
Mathf类数学操作方法 | 定义 |
Deg2Rad | 角度到弧度转化 |
Rad2Deg | 弧度到角度转换 |
NegativeIntifinity | 负无穷大 |
Infinity | 正无穷大 |
Sin | 正弦 |
Cos |