using UnityEngine; using UnityEngine.UI; using XUGL; namespace XCharts.Runtime { [ExecuteInEditMode] [RequireComponent(typeof(RectTransform))] [DisallowMultipleComponent] public class ProgressBar : BaseChart { [SerializeField][Range(0f, 1f)] private float m_Value = 0.5f; [SerializeField] private Color m_BackgroundColor = new Color32(255, 233, 233, 255); [SerializeField] private Color m_StartColor = Color.blue; [SerializeField] private Color m_EndColor = Color.red; [SerializeField] private float[] m_CornerRadius = new float[] { 0, 0, 0, 0 }; public float value { get { return m_Value; } set { m_Value = value; SetVerticesDirty(); } } public Color32 backgroundColor { get { return m_BackgroundColor; } set { m_BackgroundColor = value; SetVerticesDirty(); } } public Color32 startColor { get { return m_StartColor; } set { m_StartColor = value; SetVerticesDirty(); } } public Color32 endColor { get { return m_EndColor; } set { m_EndColor = value; SetVerticesDirty(); } } public float[] cornerRadius { get { return m_CornerRadius; } set { m_CornerRadius = value; SetVerticesDirty(); } } #if UNITY_EDITOR protected override void Reset() { base.Reset(); var title = GetOrAddChartComponent