当前位置:网站首页>Unity determines whether the UI is clicked
Unity determines whether the UI is clicked
2022-06-30 05:11:00 【Shannan HSY】
public bool IsPointerOverUIObject(Vector2 screenPosition) {
PointerEventData eventDataCurrentPosition = new PointerEventData(EventSystem.current);
eventDataCurrentPosition.position = new Vector2(screenPosition.x, screenPosition.y);
List<RaycastResult> results = new List<RaycastResult>();
EventSystem.current.RaycastAll(eventDataCurrentPosition, results);
return results.Count > 0;
}
边栏推荐
- Does the tester need to analyze the cause of the bug?
- Unity + hololens publishing settings
- Steamvr causes abnormal scene camera
- Detailed explanation of sorting sort method of JS array
- 力扣349. 两个数组的交集
- Revit二次开发---未打开项目使用面板功能
- 虚析构和纯虚析构
- Tensorflow2 of ubantu18.04 X installation
- Records of problems encountered in unity + hololens development
- PWN入门(2)栈溢出基础
猜你喜欢
虚析构和纯虚析构
Generate a slice of mesh Foundation
Harbor API 2.0 query
Unity is associated with vs. there is a compiler problem when opening
力扣704. 二分查找
Unity3d packaging and publishing APK process
Sourcetree usage
[vcs+verdi joint simulation] ~ take the counter as an example
Records of problems encountered in unity + hololens development
Redis cluster concept
随机推荐
Detailed explanation of the process of "flyingbird" small game (camera adjustment and following part)
Pytorch的安装以及入门使用
Unity/ue reads OPC UA and OPC Da data (UE4)
MinGW-w64下载文件失败the file has been downloaded incorrectly!
力扣209. 长度最小的子数组
Display steerable 3D model in front of unity UI
Steamvr causes abnormal scene camera
Very nervous. What should I do on the first day of software testing?
pycharm 数据库工具
Solution to 293 problems in the week of Li Kou
Some books you should not miss when you are new to the workplace
Records of some problems encountered during unity development (continuously updated)
Operation file file class method
Intellj idea generates jar packages for projects containing external lib to other projects. The method refers to the jar package written by itself
JPA复合主键使用
Force buckle 59 Spiral matrix II
Unity animator does not clip animation to play animation in segments
One command to run rancher
C # three ways to obtain web page content
Force buckle 27 Removing Elements