Camera.ScreenToWorldPoint
来源:互联网 发布:国服mac版魔兽世界 编辑:程序博客网 时间:2024/05/25 19:55
using UnityEngine;public class ExampleClass : MonoBehaviour{ void OnGUI() { Vector3 p = new Vector3(); Camera c = Camera.main; Event e = Event.current; Vector2 mousePos = new Vector2(); // Get the mouse position from Event. // Note that the y position from Event is inverted. mousePos.x = e.mousePosition.x; mousePos.y = c.pixelHeight - e.mousePosition.y; p = c.ScreenToWorldPoint(new Vector3(mousePos.x, mousePos.y, c.nearClipPlane)); GUILayout.BeginArea(new Rect(20, 20, 250, 120)); GUILayout.Label("Screen pixels: " + c.pixelWidth + ":" + c.pixelHeight); GUILayout.Label("Mouse position: " + mousePos); GUILayout.Label("World position: " + p.ToString("F3")); GUILayout.EndArea(); }}
阅读全文
0 0
- Camera.ScreenToWorldPoint
- Camera.ScreenToWorldPoint
- Camera.ScreenToWorldPoint
- unity中Camera.ScreenToWorldPoint
- ScreenToWorldPoint
- Unity3D中Camera类ScreenToWorldPoint方法使用解析
- <Unity笔记>Camera.ScreenToWorldPoint 屏幕转世界位置
- Unity3D -- ScreenToWorldPoint
- Unity ScreentoWorldPoint中的z坐标说明
- camera
- Camera
- camera
- Camera
- Camera
- camera
- camera
- Camera
- camera
- [leetcode] 39. Combination Sum
- Java泛型基础
- LVS三种模式配置及优点缺点比较
- swift 布局工具类
- 修改源码自定义SwipeRefreshLayout样式——高仿微信朋友圈下拉刷新
- Camera.ScreenToWorldPoint
- logistic分类(logistic回归 LR)
- 自定义win32窗口的消息无法监测,窗口注册类不能被注销。
- isset()、empty()、is_null()的区别
- 进阶高级!帮你做能落地的界面之TAB的小短线
- Spring事务管理基础概念讲解 (重点)
- (四)Tomcat分析
- (hdu 1907)John (Misère Nim,Nim博弈的变形)
- Android settings使用详解之设置优先网络