using UnityEngine; using UnityEngine.UI; public class IrregularButton : MonoBehaviour { void Awake () { // 设置阈值 Image image = GetComponent<Image>(); image.alphaHitTestMinimumThreshold = 0.1f; } }
挂载该脚本在异性按钮即可
using UnityEngine; using UnityEngine.UI; public class IrregularButton : MonoBehaviour { void Awake () { // 设置阈值 Image image = GetComponent<Image>(); image.alphaHitTestMinimumThreshold = 0.1f; } }
挂载该脚本在异性按钮即可