AkiraPixelWind/Assets/Scripts/Main/CustomCom/ShapeImage.cs

25 lines
671 B
C#
Raw Normal View History

2022-12-29 18:20:40 +08:00
using UnityEngine;
using UnityEngine.UI;
namespace Game
{
public class ShapeImage : Image
{
// <20><>бƫ<D0B1><C6AB>
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);
}
}
}