文章分类 -  Unity

上一页 1 ··· 3 4 5 6 7
摘要:. 阅读全文
posted @ 2021-11-22 14:00 匿鱼 阅读(7) 评论(0) 推荐(0)
摘要:U_3D数学基础 Dot 点乘 两个向量的点积。 点积是一个浮点值等于两个向量的大小相乘再乘以它们之间夹角的余弦值。 对于标准化向量点返回1,如果它们指向完全相同的方向,如果它们指向完全相反的方向,点返回-1,如果向量垂直,点返回0。 Cross 叉乘 两个向量的外积。 两个向量的外积会得到第三个向 阅读全文
posted @ 2021-11-11 10:51 匿鱼 阅读(40) 评论(0) 推荐(0)
摘要:[Serializable] public struct CrossData { public Image CrossImage; public Transform CrossCurrentTransform; public Transform CrossDefaultTransform; } 阅读全文
posted @ 2021-09-05 10:25 匿鱼 阅读(19) 评论(0) 推荐(0)
摘要:Unity WheelCollider 轮子碰撞体 //同步 wheelCollider 位置和旋转值至 Mesh 所在 Transform wheelCollider.GetWorldPose(out pos, out rot); wheelTransform.rotation = rot; wh 阅读全文
posted @ 2021-08-26 10:15 匿鱼 阅读(60) 评论(0) 推荐(0)
摘要:A 制作菜单工具 [MenuItem("Assets/生成配置")] public static void Create() { Debug.Log("生成配置"); } B 资源聚焦 EditorUtility.FocusProjectWindow(); // 聚焦 Selection.activ 阅读全文
posted @ 2021-08-09 15:57 匿鱼 阅读(26) 评论(0) 推荐(0)
摘要:A 旋转 绕某轴旋转一定角度,顺时针逆时针 Unity Tips: How to rotate a Vector by an angle? (youtube.com) 阅读全文
posted @ 2021-08-09 14:48 匿鱼 阅读(13) 评论(0) 推荐(0)
摘要:A Gizmod 颜色添加 1 private void OnDrawGizmos() { 2 if (null != enemy) { 3 Gizmos.color = Color.red; 4 Gizmos.DrawLine(transform.position, enemy.position) 阅读全文
posted @ 2021-08-09 10:43 匿鱼 阅读(31) 评论(0) 推荐(0)
摘要:A 根据物体的 forward 方向位移。 1 transform.position = Vector3.Lerp(transform.position, transform.position + transform.forward, Time.deltaTime); B 根据世界坐标 Forwar 阅读全文
posted @ 2021-08-09 10:29 匿鱼 阅读(90) 评论(0) 推荐(0)

上一页 1 ··· 3 4 5 6 7