1. 程式人生 > >異形按鈕點選觸發

異形按鈕點選觸發

using UnityEngine;
using UnityEngine.UI;

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

掛載該指令碼在異性按鈕即可