using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; //改变UI触发的alpha值 alpha值小于一定程度时 无法触发UI点击事件 public class UIAlphaHitCtrl : MonoBehaviour { [Range(0,0.5f)] public float alpha; // Start is called before the first frame update void Start() { this.GetComponent().alphaHitTestMinimumThreshold = alpha; } }