当前位置:网站首页>Unity3D Button mouse hover enter and mouse hover exit button events
Unity3D Button mouse hover enter and mouse hover exit button events
2022-07-31 02:40:00 【java can fly】
Requirements
Because Party A's acceptance failed, the project needs to be revised. When modifying the interface, I want to realize the function of displaying the second-level menu by hovering the mouse over the first-level menu. The main picture is as follows
Note that the mouse in the above picture is only hovering over the scene roaming button, and there is no left or right click, etc.
Implementation method
The idea is to let the class inherit the two interfaces of IPointerEnterHandler and IPointerExitHandler, and then implement the methods.
The code is as follows:
using System.span>Collections;using System.Collections.Generic;using UnityEngine;using UnityEngine.UI;using UnityEngine.EventSystems;public class ScentRoamButtonControl : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler{/// /// Buttons for all scene walkthrough modules/// public GameObject SceneButtons;public void OnPointerEnter(PointerEventData eventData){//throw new System.NotImplementedException();//Debug.Log("111");SceneButtons.SetActive(true);}public void OnPointerExit(PointerEventData eventData){//throw new System.NotImplementedException();SceneButtons.SetActive(false);}}边栏推荐
- 系统需求多变如何设计
- The final exam first year course
- CMOS和TTL的区别?
- 8、统一处理异常(控制器通知@ControllerAdvice全局配置类、@ExceptionHandler统一处理异常)
- 19.支持向量机-优化目标和大间距直观理解
- Inter-vlan routing + static routing + NAT (PAT + static NAT) comprehensive experiment
- 4、敏感词过滤(前缀树)
- Discourse 自定义头部链接(Custom Header Links)
- 软件积累 -- 截图软件ScreenToGif
- STP选举(步骤+案列)详解
猜你喜欢

php 网站的多语言设置(IP地址区分国内国外)

工程(五)——小目标检测tph-yolov5

Manchester City confuses fans with smart scarf that detects emotions

coldfusion8 background scheduled tasks take shell

User interaction + formatted output

怎样做好一个创业公司CTO?

数学解决——环形链表问题

Difference between CMOS and TTL?

8、统一处理异常(控制器通知@ControllerAdvice全局配置类、@ExceptionHandler统一处理异常)

mycat的主从关系 垂直分库 水平分表 以及mycat分片联表查询的配置详解(mysql5.7系列)
随机推荐
Unity3D Button 鼠标悬浮进入与鼠标悬浮退出按钮事件
Tower of Hanoi problem
自动化办公案例:如何自动生成期数据?
8、统一处理异常(控制器通知@ControllerAdvice全局配置类、@ExceptionHandler统一处理异常)
Linux下redis7的安装,启动与停止
[1153] The boundary range of between in mysql
6、显示评论和回复
Coldfusion file read holes (CVE - 2010-2861)
How to do a startup CTO?
SQL注入 Less47(报错注入) 和Less49(时间盲注)
LeetCode 每日一题 2022/7/25-2022/7/31
Software Testing Defect Reporting - Definition, Composition, Defect Lifecycle, Defect Tracking Post-Production Process, Defect Tracking Process, Purpose of Defect Tracking, Defect Management Tools
Unity界面总体介绍
CentOS7下mysql5.7.37的安装【完美方案】
全流程调度——MySQL与Sqoop
mysql view
Manchester City confuses fans with smart scarf that detects emotions
ShardingJDBC使用总结
【shell基础】判断目录是否为空
Why is String immutable?