Files
JJBB/Assets/Project/Script/Player/Controller/UGuiEmptyImage.cs
2024-08-23 15:49:34 +08:00

24 lines
642 B
C#

using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class UGuiEmptyImage : MaskableGraphic
{
protected override void OnPopulateMesh(VertexHelper vh)
{
vh.Clear();
}
private void OnDrawGizmos()
{
Gizmos.color = Color.grey;
Vector3[] worldCorners = new Vector3[4];
rectTransform.GetWorldCorners(worldCorners);
for (int i = 0; i < worldCorners.Length; i++)
{
var target = i + 1;
if (target >= worldCorners.Length)
target = 0;
Gizmos.DrawLine(worldCorners[i], worldCorners[target]);
}
}
}