异形按钮点击触发

Posted vr-1024

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了异形按钮点击触发相关的知识,希望对你有一定的参考价值。

using UnityEngine;
using UnityEngine.UI;

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

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

以上是关于异形按钮点击触发的主要内容,如果未能解决你的问题,请参考以下文章