UGUI之判断是否点在UI上
来源:互联网 发布:帝国cms在线视频 编辑:程序博客网 时间:2024/05/20 11:19
if (Input.touchSupported) {if (Input.touchCount > 0) {if(Input.touches[0].phase== TouchPhase.Began){if (EventSystem.current.IsPointerOverGameObject (Input.GetTouch (0).fingerId))isOnGUGI = true;}} else {isOnGUGI = false;}} else {if (Input.GetMouseButtonDown (0)) {if (EventSystem.current.IsPointerOverGameObject ())isOnGUGI = true;} else if (Input.GetMouseButtonUp (0)) {isOnGUGI = false;}}
简单的处理方式,需要在Resources文件夹下面先放一个EventSystem的Prefab
/// <summary>/// 判断鼠标是否在UI上面/// </summary>/// <returns><c>true</c>, if mouse on U was checked, <c>false</c> otherwise.</returns>public static bool CheckMouseOnUI(){if(EventSystem.current){if(Input.touchSupported && Input.touchCount>0){return EventSystem.current.IsPointerOverGameObject (Input.GetTouch(0).fingerId);}else{return EventSystem.current.IsPointerOverGameObject ();}}else{GameObject.Instantiate(Resources.Load("UI/EventSystem"));}return false;}
0 0
- UGUI之判断是否点在UI上
- UGUI判断鼠标或者手指是否点击在UI上
- UGUI判断鼠标或者手指是否点击在UI上
- UGUI如何判断鼠标是否在UI上
- Unity3d UGUI判断鼠标是否在UI上
- UGUI 之 判断鼠标或者手指是否点击在UI上
- UGUI研究院之判断鼠标或者手指是否点击在UI上
- UGUI研究院之判断鼠标或者手指是否点击在UI上
- Unity UGUI 是否点击在UI上
- UGUI - 判断是否点击在UI 上 Bug,IsPointerOverGameObject()在移动端检测失败
- UGUI -(unity3d 5)判断是否点击在UI 上 Bug,IsPointerOverGameObject()在移动输入模式检测失败
- ugui与ngui如何检测是否点击在UI上
- ugui 判断鼠标是否进入ui
- 判断点是否在直线上
- c#判断点是否在矩形上
- c#判断点是否在直线上
- hdu1756( 判断点是否在多边形上)
- C#判断点是否在直线上
- jquery attr()方法.
- 编译wireshark遇到的问题
- GridView使用CommandField删除列实现删除时提示确认框
- Git基本用法
- Xcode6中如何添加pch文件
- UGUI之判断是否点在UI上
- 标准是怎么制定出来的?
- Android 获取手机分辨率
- 循环17~21
- 介绍Android中的Paint和Canvas的概念和使用方法
- mongodb条件查询
- 【leetcode每日一题】149.Max Points on a line
- Hibernate关联之一对一外键双向关联
- 二分查找的实现