异形按钮点击触发

using UnityEngine;
using UnityEngine.UI;

public class IrregularButton : MonoBehaviour { 
    void Awake () {
        // 设置阈值
        Image image = GetComponent<Image>();
        image.alphaHitTestMinimumThreshold = 0.1f;
    }  
}

挂载该脚本在异性按钮即可

猜你喜欢

转载自www.cnblogs.com/VR-1024/p/9815445.html