当前位置:网站首页>Unity mask click the lower UI game to start guiding Click
Unity mask click the lower UI game to start guiding Click
2022-04-22 07:51:00 【Dream back to Datang knock code】
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.EventSystems; public class DIANJI : MonoBehaviour, ICanvasRaycastFilter { /// <summary> /// Button to click /// </summary> public GameObject onClockButton; public bool IsRaycastLocationValid(Vector2 screenPoint, Camera eventCamera) { Vector2 localPoint; Debug.Log(screenPoint); RectTransformUtility.ScreenPointToLocalPointInRectangle(GameObject.Find("Canvas").GetComponent<RectTransform>(),screenPoint, eventCamera, out localPoint); if (onClockButton.GetComponent<RectTransform>().rect.Contains(localPoint)) { return false; } else { return true; } } }
The code is mounted to the to be penetrated UI On
Use mask to

Turn off the click event response of the mask
版权声明
本文为[Dream back to Datang knock code]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220621526608.html
边栏推荐
猜你喜欢
随机推荐
Unity Update当前帧与上一帧鼠标的差值获取
C-10 年龄问题
谷歌缓存清理插件
数据库增删改查
Instructions for functional interface @ functionalinterface
【TCP/IP 一 概述】
Stm32外设篇 [一]IO
小程序 - 超过两件折叠展开逻辑
Distinction
Operation of SM2 encryption signature verification
C#中分支的使用
Problem D: 孪生素数
函数式接口@FunctionalInterface的使用说明
Stm32外设篇 [三] 串口 RS232 RS485
JWT实现登录认证,密码加密及Token校验全过程(附源码)
从零学C语言 【一】基本概念
Wechat payment and receipt version docking
一次敏感词检测开发记录
Enumerations and structures in C #
获取当前dll或者exe路径





![单片机原理[一] 学好单片机必会的五张图](/img/49/bf1cdb477622375dd558e4c6b1cf60.jpg)



