项目中想对UGUI触发事件拦截可使用空Button,这样减少overdraw。很多文章都记录了,这里就自己记录一下,方便查阅
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class EmptyButton : MaskableGraphic
{
protected override void OnPopulateMesh(VertexHelper vh)
{
vh.Clear();
}
}