AkiraPixelWind/Assets/Scripts/Main/CustomCom/ShapeImage.cs
2022-12-29 18:20:40 +08:00

25 lines
671 B
C#

using UnityEngine;
using UnityEngine.UI;
namespace Game
{
public class ShapeImage : Image
{
// ÇãбƫÒÆ
public float offset;
protected override void OnPopulateMesh(VertexHelper toFill)
{
base.OnPopulateMesh(toFill);
UIVertex vertex = new UIVertex();
toFill.PopulateUIVertex(ref vertex, 1);
vertex.position += Vector3.right * offset;
toFill.SetUIVertex(vertex, 1);
vertex = new UIVertex();
toFill.PopulateUIVertex(ref vertex, 2);
vertex.position += Vector3.right * offset;
toFill.SetUIVertex(vertex, 2);
}
}
}