This commit is contained in:
monitor1394
2022-03-09 07:26:15 +08:00
parent 5745fea9a1
commit 7582a76d1f
55 changed files with 504 additions and 275 deletions

View File

@@ -0,0 +1,33 @@
using UnityEngine;
using UnityEngine.UI;
using XUGL;
namespace XCharts.Runtime
{
[ExecuteInEditMode]
public class SVGImage : MaskableGraphic
{
[SerializeField] private bool m_MirrorY;
[SerializeField] private string m_SVGPath;
private SVGPath m_Path;
public string svgPath { get { return m_SVGPath; } }
public bool mirrorY { get { return m_MirrorY; } }
protected override void Awake()
{
base.Awake();
m_Path = SVGPath.Parse(m_SVGPath);
m_Path.mirrorY = m_MirrorY;
}
protected override void OnPopulateMesh(VertexHelper vh)
{
vh.Clear();
if (m_Path != null)
m_Path.Draw(vh);
}
}
}