当前位置:网站首页>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);}}边栏推荐
猜你喜欢

multiplayer-hlap 包有问题,无法升级的解决方案

【Bank Series Phase 1】People's Bank of China

公司官网建站笔记(六):域名进行公安备案并将备案号显示在网页底部

Pythagorean tuple od js

STM32CUBEMX develops GD32F303 (11) ---- ADC scans multiple channels in DMA mode

mysql 视图

coldfusion8 background scheduled tasks take shell

4、敏感词过滤(前缀树)

AI在医疗影像设备全流程应用

Basic introduction to ShardingJDBC
随机推荐
The real CTO is a technical person who understands products
Static routing + PAT + static NAT (explanation + experiment)
7、私信列表
FPGA-based vending machine
f.grid_sample
项目开发软件目录结构规范
CentOS7下mysql5.7.37的安装【完美方案】
Manchester City confuses fans with smart scarf that detects emotions
16. Registration Center-consul
关于 mysql8.0数据库中主键位id,使用replace插入id为0时,实际id插入后自增导致数据重复插入 的解决方法
mysql view
The application of AI in the whole process of medical imaging equipment
经典链表OJ强训题——快慢双指针高效解法
【CV项目调试】CUDNN_CONVOLUTION_FWD_SPECIFY_WORKSPACE_LIMIT问题
基于opencv实现人脸检测
Inter-vlan routing + static routing + NAT (PAT + static NAT) comprehensive experiment
Unity3D Button 鼠标悬浮进入与鼠标悬浮退出按钮事件
【shell基础】判断目录是否为空
Unity界面总体介绍
SQL注入 Less47(报错注入) 和Less49(时间盲注)