当前位置: 首页 > news >正文

wordpress 后台栏目权威seo技术

wordpress 后台栏目,权威seo技术,建网站规则,出口外贸营销网站Unity的EventSystem是用于处理用户输入和交互的系统。它是Unity UI系统的核心组件之一#xff0c;可以用于捕捉和分发各种事件#xff0c;例如点击、拖拽、按键、射线等。 常用的属性和方法有以下这些#xff1a; 属性#xff1a; current: 获取当前的EventSystem实例。…Unity的EventSystem是用于处理用户输入和交互的系统。它是Unity UI系统的核心组件之一可以用于捕捉和分发各种事件例如点击、拖拽、按键、射线等。 常用的属性和方法有以下这些 属性 current: 获取当前的EventSystem实例。sendNavigationEvents: 一个布尔值表示是否发送导航事件。pixelDragThreshold: 拖动的像素阈值。currentInputModule: 获取当前激活的InputModule实例。 方法  IsPointerOverGameObject(int pointerId): 检查指定的指针事件是否发生在UI元素上。SetSelectedGameObject(GameObject selected): 设置当前选中的游戏对象默认使用PointerInputModule来处理选中事件。SetSelectedGameObject(GameObject selected, BaseEventData pointer): 设置当前选中的游戏对象并传递BaseEventData参数。Raycast(PointerEventData eventData, ListRaycastResult resultAppendList): 执行射线检测并返回与射线相交的最上层的UI元素。 常见用法 1、 获取当前点击的UI元素 EventSystem eventSystem EventSystem.current; GameObject selectedObject eventSystem.currentSelectedGameObject; 2、判断鼠标或指定指针是否在UI元素上 //不带参数pointerId默认为-1表示鼠标左键 EventSystem eventSystem EventSystem.current; bool isPointerOverUI eventSystem.IsPointerOverGameObject();//带参数指定指针 bool isPointerOverUI1 EventSystem.IsPointerOverGameObject(pointerId); if (isPointerOverUI1) {// 当前指针在UI上 } 3、设置导航事件的发送 EventSystem eventSystem GetComponentEventSystem(); eventSystem.sendNavigationEvents true; 4、设置拖动的像素阈值 EventSystem eventSystem GetComponentEventSystem(); eventSystem.pixelDragThreshold 10; 5、当前手指是否触摸在UI上 EventSystem eventSystem EventSystem.current; Touch[] touches Input.touches; foreach (Touch touch in touches) {if (eventSystem.IsPointerOverGameObject(touch.fingerId)){// 当前是否触摸在UI上} } 6、发送自定义事件: 比如我在场景中创建一个组件如Image并把下面脚本放到组件上 using UnityEngine; using UnityEngine.EventSystems;public class CustomEventHandler : MonoBehaviour, IPointerClickHandler {public void OnPointerClick(PointerEventData eventData){Debug.Log(你触发了自定义事件);// 在这里处理自定义事件的逻辑} } 然后我再创建如下脚本放到场景中 using UnityEngine; using UnityEngine.EventSystems;public class CustomEventTrigger : MonoBehaviour {private void Start(){// 获取EventSystem实例EventSystem eventSystem EventSystem.current;// 获取自定义事件的目标游戏对象GameObject targetObject GameObject.Find(Image);// 触发自定义事件eventSystem.SetSelectedGameObject(targetObject);} }当我点击Image时就可以触发自定义事件了如下图。
http://wiki.neutronadmin.com/news/410316/

相关文章:

  • 做外贸在哪个网站小程序视频网站开发
  • 金华网站建设yw126上海做网站建设公司
  • 万维网站注册如何重装wordpress
  • 汕头网站专业制作北京商务网站建设
  • app应用程序西城区网站建设推广seo
  • 能接做网站的活的网站邮件营销 wordpress
  • 网站建设与维护制作网页网站备案号的链接
  • 在线企业建站服务如何制作小程序码
  • 淄博网站搭建公司店群智能营销管理系统
  • 西安网站建设全包沈阳网站建设信息
  • 学而思编程网站wordpress主题用户中心
  • 郑州一建集团有限公司电话网页关键词优化
  • 济南手工网站建设中国电信黄页app
  • 许昌长葛网站建设制作设计godaddy网站建设
  • 天津网站建设流程有自己团队做网站上线多久
  • 哈尔滨营销型网站制作建网是什么
  • 北京网站建站网站建设需要几十万
  • 建站历史查询网站开发需求说明书模板
  • 开源php网站开发网站特效怎么做
  • 网站线框图wordpress如何修改
  • 网站建设职业规划网站开发视频 百度云
  • 大淘客怎样做网站自建网站h5
  • 专业做网站建设公司哪家好东营建设企业网站
  • 网站服务器机房芜湖企业做网站
  • 青岛 php 网站建设wordpress计时
  • 有关网站开发的文章贵州软件开发 网站开发
  • 廊坊网站建设咨询青橙网络企业网站推广推广阶段
  • 个人网站做交易类的赚钱吗做网站不给源码程序
  • 网站哪里做昆明公司有哪些
  • 做公众号和网站一样吗怎样通过网络销售自己的产品