23 lines
531 B
C#
23 lines
531 B
C#
|
using UnityEngine;
|
|||
|
using UnityEngine.UI;
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 用于不做渲染的UI对象,仅保留射线检测
|
|||
|
/// </summary>
|
|||
|
[RequireComponent(typeof(CanvasRenderer))]
|
|||
|
public class NonDraw : Graphic
|
|||
|
{
|
|||
|
protected override void Awake()
|
|||
|
{
|
|||
|
base.color = Color.clear;
|
|||
|
}
|
|||
|
|
|||
|
protected override void OnPopulateMesh(VertexHelper vh)
|
|||
|
{
|
|||
|
vh.Clear();
|
|||
|
}
|
|||
|
|
|||
|
// 重写方法以避免不必要的重绘调用
|
|||
|
public override void SetMaterialDirty() { }
|
|||
|
public override void SetVerticesDirty() { }
|
|||
|
}
|