当前位置:网站首页>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);}}边栏推荐
- Drools规则属性,高级语法
- 知识蒸馏7:知识蒸馏代码详解
- The real CTO is a technical person who understands products
- Installation, start and stop of redis7 under Linux
- BAT can't sell "Medical Cloud": Hospitals flee, mountains stand, and there are rules
- tcp框架需要解决的问题
- mysql 视图
- Real-time image acquisition based on FPGA
- SQL注入 Less46(order by后的注入+rand()布尔盲注)
- 经典链表OJ强训题——快慢双指针高效解法
猜你喜欢

Static routing + PAT + static NAT (explanation + experiment)

10 权限介绍

Static route analysis (the longest mask matching principle + active and standby routes)

Manchester City confuses fans with smart scarf that detects emotions

完整复制虚拟机原理(云计算)

字体压缩神器font-spider的使用

Maximum area of solar panel od js

Pythagorean tuple od js

Basic learning about Redis related content

力扣刷题之爬楼梯(7/30)
随机推荐
The real CTO is a technical person who understands products
AtCoder Beginner Contest 261 部分题解
如何搭建私有yum源
Software testing basic interface testing - getting started with Jmeter, you should pay attention to these things
16. Registration Center-consul
There is a problem with the multiplayer-hlap package and the solution cannot be upgraded
Static routing + PAT + static NAT (explanation + experiment)
Unity3D Button 鼠标悬浮进入与鼠标悬浮退出按钮事件
mysql 视图
【shell基础】判断目录是否为空
Manchester City confuses fans with smart scarf that detects emotions
Linux下redis7的安装,启动与停止
10、Redis实现点赞(Set)和获取总点赞数
221. Largest Square
LeetCode 1161 The largest element in the layer and the LeetCode road of [BFS binary tree] HERODING
验证整数输入
LeetCode 每日一题 2022/7/25-2022/7/31
跨专业考研难度大?“上岸”成功率低?这份实用攻略请收下!
19. Support Vector Machines - Intuitive Understanding of Optimization Objectives and Large Spacing
公司官网建站笔记(六):域名进行公安备案并将备案号显示在网页底部