当前位置:网站首页>Unity Button长按检测
Unity Button长按检测
2022-04-21 06:28:00 【菜菜码农柠檬哥】
调用Unity自带接口即可,代码如下:
public class upSpeed : MonoBehaviour,IPointerDownHandler,IPointerUpHandler
{
// Start is called before the first frame update
private void Awake()
{
this.gameObject.GetComponent<Button>();
}
// Update is called once per frame
public void OnPointerDown(PointerEventData eventData)
{
//TODO
}
public void OnPointerUp(PointerEventData eventData)
{
//TODO
}
}
其中OnPointerDown为持续按下检测,OnPointerUp为持续抬起检测。
版权声明
本文为[菜菜码农柠檬哥]所创,转载请带上原文链接,感谢
https://blog.csdn.net/y1139735983/article/details/116850730
边栏推荐
- 3D-MAX之Shader工具(描边)
- mmdetection 使用自定义数据集训练 将数据集转为COCO格式
- Dpdk-16.04 IGB CRC length statistics
- 「Tarjan」无向图强连通分量
- Method and principle of obtaining the CPU core of the last execution of the process
- C语言版:二叉树的遍历方式和逆序
- postgres uuid_generate_v1() does not exist
- Micro Service -- service splitting strategy and principle
- you-get 命令与踩坑
- Change picture suffix
猜你喜欢

【手部姿态估计】【论文精度】Pose Guided Structured Region Ensemble Network for Cascaded Hand Pose Estimation

图形学基础|实时阴影渲染

Fundamentals of graphics | area light rendering based on LTC

WordPress address siteurl error, unable to log in solution
Fundamentals of graphics | cartoon shadow map based on SDF

C语言版:二叉树的动态建立

3D-MAX之Shader工具(描边)

【LeetCode 67】二个进制数求和

程序启动顺序引发的血案之 dpdk 进程死锁

C语言版:二叉树叶子结点和非叶子结点求法
随机推荐
C语言版:链队的建立和基本操作
Dpdk problem analysis: dpdk-20.11 ice 100g network card RSS_ Invalid hash configuration
How to prevent SQL injection
基于UnityGameFramework框架的临时数据节点使用
Change picture suffix
「Tarjan」有向图强连通分量
力扣-354.俄罗斯套娃信封问题
HLOJ 1936 铺满方格
【LeetCode 67】二个进制数求和
Could not initialize cudnn ,please check cudnn installation.
Unity 射击游戏的准星位置
读书笔记-思维的精进
TX2上运行ENet
dpdk 问题分析:dpdk-20.11 ice 100G 网卡 rss_hash 配置无效问题
unreal连接MySQL
dpdk-16.04 igb crc length 统计问题
【论文精读】Deep Surface Normal Estimation with Hierarchical RGB-D Fusion
动画—Keyframes介绍
Unreal Engine notes summary (continuously updated...)
PowerShell - 因为在此系统上禁止运行脚本