![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
unity2d游戏基础
weixin_41727741
这个作者很懒,什么都没留下…
展开
-
unity 鼠标位置转换成世界坐标
方法一Vector3 pos= Camera.main.WorldToScreenPoint(transform .position );//将对象坐标换成屏幕坐标 Vector3 mousePos = new Vector3(Input.mousePosition.x, Input.mousePosition.y, pos.z);//让鼠标的屏幕坐标与对象坐标一致 ...原创 2018-02-10 12:00:52 · 11164 阅读 · 0 评论 -
unity 相机跟随2D
float posX = transform.position.x; Camera.main.transform.position = Vector3.Lerp(Camera.main.transform.position, new Vector3(Mathf.Clamp(posX, 0, 15), Camera.main.transform.position.y, Camera.main.tr...翻译 2018-02-20 10:32:48 · 1134 阅读 · 0 评论