XCharts 2.0

This commit is contained in:
monitor1394
2021-01-11 08:54:28 +08:00
parent ed8d0687f7
commit 489095865d
304 changed files with 14799 additions and 12503 deletions

View File

@@ -1,9 +1,9 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using System;
using UnityEngine;
@@ -15,33 +15,14 @@ namespace XCharts
/// 坐标轴在 grid 区域中的分隔线。
/// </summary>
[Serializable]
public class AxisSplitLine : SubComponent
public class AxisSplitLine : BaseLine
{
[SerializeField] private bool m_Show;
[SerializeField] private int m_Interval;
[SerializeField] private LineStyle m_LineStyle = new LineStyle(0.7f);
/// <summary>
/// Set this to true to show the split line.
/// 是否显示分隔线。
/// </summary>
public bool show
{
get { return m_Show; }
set { if (PropertyUtility.SetStruct(ref m_Show, value)) SetVerticesDirty(); }
}
public int interval
{
get { return m_Interval; }
set { if (PropertyUtility.SetStruct(ref m_Interval, value)) SetVerticesDirty(); }
}
/// <summary>
/// 线条样式
/// </summary>
public LineStyle lineStyle
{
get { return m_LineStyle; }
set { if (value != null) { m_LineStyle = value; SetVerticesDirty(); } }
set { if (PropertyUtil.SetStruct(ref m_Interval, value)) SetVerticesDirty(); }
}
public override bool vertsDirty { get { return m_VertsDirty || m_LineStyle.anyDirty; } }
@@ -72,23 +53,8 @@ namespace XCharts
public void Copy(AxisSplitLine splitLine)
{
show = splitLine.show;
base.Copy(splitLine);
interval = splitLine.interval;
lineStyle.Copy(splitLine.lineStyle);
}
internal Color32 GetColor(ThemeInfo theme)
{
if (!ChartHelper.IsClearColor(lineStyle.color))
{
return lineStyle.GetColor();
}
else
{
var color = theme.axisSplitLineColor;
color.a = (byte)(color.a * lineStyle.opacity);
return color;
}
}
internal bool NeedShow(int index)