![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
游戏开发
kimojinmmp
这个作者很懒,什么都没留下…
展开
-
unity 朝着一个方向旋转
方向转为浮点数(来源:CodeMonkey插件) float GetAngleFromVectorFloat(Vector3 dir) { dir = dir.normalized; float n = Mathf.Atan2(dir.y, dir.x) * Mathf.Rad2Deg; if (n < 0) n += 360; return n; //用法: tranform.eulerAngles=ne原创 2020-12-09 16:00:19 · 429 阅读 · 0 评论 -
游戏开发之路 二
开发Demo 一 1.角色功能 ① 朝着鼠标点击方向转动:(Done) Vector3 Move_Player(){ Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hitInfo; if(Physics.Raycast(ray, out hitInfo, 200, whatIsGround)){ Vector3 target =原创 2020-12-09 15:45:49 · 85 阅读 · 0 评论