mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-22 17:00:08 +00:00
XCharts 2.0
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user