当前位置:网站首页>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);}}边栏推荐
- Layer 2 broadcast storm (cause + judgment + solution)
- Force buckled brush the stairs (7/30)
- Hanyuan Hi-Tech 8-channel HDMI integrated multi-service high-definition video optical transceiver 8-channel HDMI video + 8-channel two-way audio + 8-channel 485 data + 8-channel E1 + 32-channel teleph
- 汉源高科8路HDMI综合多业务高清视频光端机8路HDMI视频+8路双向音频+8路485数据+8路E1+32路电话+4路千兆物理隔离网络
- Problems that need to be solved by the tcp framework
- 16、热帖排行
- MPPT solar charge controller data collection - through the gateway acquisition capacity battery SOC battery voltage, wi-fi
- Clustering index, and what is the difference between a clustering index
- Project development software directory structure specification
- Detailed explanation of STP election (step + case)
猜你喜欢

Face detection based on opencv

Word/Excel fixed table size, when filling in the content, the table does not change with the cell content

共模电感的仿真应用来了,满满的干货送给大家

f.grid_sample

What level of software testing does it take to get a 9K job?

Manchester City confuses fans with smart scarf that detects emotions

Drools规则属性,高级语法

Software testing basic interface testing - getting started with Jmeter, you should pay attention to these things

How to do a startup CTO?

MPPT solar charge controller data collection - through the gateway acquisition capacity battery SOC battery voltage, wi-fi
随机推荐
【Bank Series Phase 1】People's Bank of China
Software Testing Defect Reporting - Definition, Composition, Defect Lifecycle, Defect Tracking Post-Production Process, Defect Tracking Process, Purpose of Defect Tracking, Defect Management Tools
MPPT solar charge controller data collection - through the gateway acquisition capacity battery SOC battery voltage, wi-fi
拒绝加班,程序员开发的效率工具集
16、热帖排行
Fiddler captures packets to simulate weak network environment testing
Linux下redis7的安装,启动与停止
CMOS和TTL的区别?
汉源高科8路HDMI综合多业务高清视频光端机8路HDMI视频+8路双向音频+8路485数据+8路E1+32路电话+4路千兆物理隔离网络
print task sorting js od huawei
静态路由解析(最长掩码匹配原则+主备路由)
Hanyuan Hi-Tech 8-channel HDMI integrated multi-service high-definition video optical transceiver 8-channel HDMI video + 8-channel two-way audio + 8-channel 485 data + 8-channel E1 + 32-channel teleph
The principle of complete replication of virtual machines (cloud computing)
FPGA-based vending machine
vlan间路由+静态路由+NAT(PAT+静态NAT)综合实验
字体压缩神器font-spider的使用
【银行系列第一期】中国人民银行
mmdetection训练一个模型相关命令
ShardingJDBC使用总结
系统需求多变如何设计