mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-24 18:00:26 +00:00
3.0
This commit is contained in:
33
Runtime/Widgets/SVGImage.cs
Normal file
33
Runtime/Widgets/SVGImage.cs
Normal 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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user