From bfa68fd037c31de5b5ad8b0667b0bcf67b6d277b Mon Sep 17 00:00:00 2001 From: monitor1394 Date: Wed, 16 Mar 2022 07:43:46 +0800 Subject: [PATCH] refactor code to support 3d pie --- Assets/XCharts/Runtime/Component/Main/Serie.cs | 16 ++++++++-------- .../Runtime/Component/Sub/SerieAnimation.cs | 8 ++++---- .../XCharts/Runtime/Component/Sub/SerieData.cs | 14 +++++++------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Assets/XCharts/Runtime/Component/Main/Serie.cs b/Assets/XCharts/Runtime/Component/Main/Serie.cs index 316c32af..277011d5 100644 --- a/Assets/XCharts/Runtime/Component/Main/Serie.cs +++ b/Assets/XCharts/Runtime/Component/Main/Serie.cs @@ -1142,12 +1142,12 @@ public override void ClearComponentDirty() /// The index of serie,start at 0. /// 系列的索引,从0开始。 /// - public int index { get; internal set; } + public int index { get; set; } /// /// Whether the serie is highlighted. /// 该系列是否高亮,一般由图例悬停触发。 /// - public bool highlighted { get; internal set; } + public bool highlighted { get; set; } /// /// the count of data list. /// 数据项个数。 @@ -1160,27 +1160,27 @@ public override void ClearComponentDirty() /// /// 饼图的中心点位置。 /// - public Vector3 runtimeCenterPos { get; internal set; } + public Vector3 runtimeCenterPos { get; set; } /// /// 饼图的内径 /// - public float runtimeInsideRadius { get; internal set; } + public float runtimeInsideRadius { get; set; } /// /// 饼图的外径 /// - public float runtimeOutsideRadius { get; internal set; } + public float runtimeOutsideRadius { get; set; } /// /// 运行时的最大数据值 /// - public double runtimeDataMax { get; internal set; } + public double runtimeDataMax { get; set; } /// /// 运行时的最小数据值 /// - public double runtimeDataMin { get; internal set; } + public double runtimeDataMin { get; set; } /// /// 饼图的数据项之和 /// - public double runtimePieDataTotal { get; internal set; } + public double runtimePieDataTotal { get; set; } public float runtimeWaveSpeed { get; internal set; } public Painter runtimeCanvas { get; internal set; } public double runtimeCheckValue { get; set; } diff --git a/Assets/XCharts/Runtime/Component/Sub/SerieAnimation.cs b/Assets/XCharts/Runtime/Component/Sub/SerieAnimation.cs index 4479521f..15f79cae 100644 --- a/Assets/XCharts/Runtime/Component/Sub/SerieAnimation.cs +++ b/Assets/XCharts/Runtime/Component/Sub/SerieAnimation.cs @@ -383,7 +383,7 @@ public bool NeedAnimation(int dataIndex) else return dataIndex <= m_CurrDataProgress; } - internal void CheckProgress(double total) + public void CheckProgress(double total) { if (IsFinish()) return; if (!m_IsInit || m_IsPause || m_IsEnd) return; @@ -411,7 +411,7 @@ internal void CheckProgress(double total) } } - internal float GetCurrAnimationDuration(int dataIndex = -1) + public float GetCurrAnimationDuration(int dataIndex = -1) { if (dataIndex >= 0) { @@ -422,7 +422,7 @@ internal float GetCurrAnimationDuration(int dataIndex = -1) else return m_FadeInDuration > 0 ? m_FadeInDuration / 1000 : 1f; } - internal float CheckBarProgress(int dataIndex, float barHig, int dataCount, out bool isBarEnd) + public float CheckBarProgress(int dataIndex, float barHig, int dataCount, out bool isBarEnd) { isBarEnd = false; var initHig = m_FadeOut ? barHig : 0; @@ -468,7 +468,7 @@ public void AllBarEnd() End(); } - internal void CheckSymbol(float dest) + public void CheckSymbol(float dest) { if (!enable || m_IsEnd || m_IsPause || !m_IsInit) return; if (IsInDelay()) return; diff --git a/Assets/XCharts/Runtime/Component/Sub/SerieData.cs b/Assets/XCharts/Runtime/Component/Sub/SerieData.cs index 3bc41a63..702dbb8b 100644 --- a/Assets/XCharts/Runtime/Component/Sub/SerieData.cs +++ b/Assets/XCharts/Runtime/Component/Sub/SerieData.cs @@ -143,23 +143,23 @@ public bool ignore /// /// 饼图数据项的开始角度(运行时自动计算) /// - public float runtimePieStartAngle { get; internal set; } + public float runtimePieStartAngle { get; set; } /// /// 饼图数据项的结束角度(运行时自动计算) /// - public float runtimePieToAngle { get; internal set; } + public float runtimePieToAngle { get; set; } /// /// 饼图数据项的一半时的角度(运行时自动计算) /// - public float runtimePieHalfAngle { get; internal set; } + public float runtimePieHalfAngle { get; set; } /// /// 饼图数据项的当前角度(运行时自动计算) /// - public float runtimePieCurrAngle { get; internal set; } + public float runtimePieCurrAngle { get; set; } /// /// 饼图数据项的内半径 /// - public float runtimePieInsideRadius { get; internal set; } + public float runtimePieInsideRadius { get; set; } /// /// 饼图数据项的外半径 /// @@ -170,7 +170,7 @@ public float runtimePieOutsideRadius if (radius > 0) return radius; else return m_RtPieOutsideRadius; } - internal set + set { m_RtPieOutsideRadius = value; } @@ -178,7 +178,7 @@ internal set /// /// 饼图数据项的偏移半径 /// - public float runtimePieOffsetRadius { get; internal set; } + public float runtimePieOffsetRadius { get; set; } public Vector3 runtimePosition { get; set; } /// /// 绘制区域。