fix add main component error

This commit is contained in:
monitor1394
2022-03-31 21:54:34 +08:00
parent 426d437e6d
commit 1ed0ff377a
7 changed files with 45 additions and 42 deletions

View File

@@ -543,7 +543,7 @@ namespace XCharts.Runtime
} }
} }
internal void CheckSymbol(float dest) public void CheckSymbol(float dest)
{ {
if (!enable || m_IsEnd || m_IsPause || !m_IsInit) if (!enable || m_IsEnd || m_IsPause || !m_IsInit)
return; return;

View File

@@ -9,6 +9,7 @@ namespace XCharts.Runtime
/// |极坐标系的角度轴。 /// |极坐标系的角度轴。
/// </summary> /// </summary>
[System.Serializable] [System.Serializable]
[RequireChartComponent(typeof(PolarCoord))]
[ComponentHandler(typeof(AngleAxisHandler), true)] [ComponentHandler(typeof(AngleAxisHandler), true)]
public class AngleAxis : Axis public class AngleAxis : Axis
{ {

View File

@@ -8,6 +8,7 @@ namespace XCharts.Runtime
/// |极坐标系的径向轴。 /// |极坐标系的径向轴。
/// </summary> /// </summary>
[System.Serializable] [System.Serializable]
[RequireChartComponent(typeof(PolarCoord))]
[ComponentHandler(typeof(RadiusAxisHandler), true)] [ComponentHandler(typeof(RadiusAxisHandler), true)]
public class RadiusAxis : Axis public class RadiusAxis : Axis
{ {

View File

@@ -11,7 +11,6 @@ namespace XCharts.Runtime
/// </summary> /// </summary>
[Serializable] [Serializable]
[ComponentHandler(typeof(PolarCoordHandler), true)] [ComponentHandler(typeof(PolarCoordHandler), true)]
[RequireChartComponent(typeof(AngleAxis), typeof(RadiusAxis))]
public class PolarCoord : CoordSystem, ISerieContainer public class PolarCoord : CoordSystem, ISerieContainer
{ {
[SerializeField] private bool m_Show = true; [SerializeField] private bool m_Show = true;
@@ -32,8 +31,8 @@ namespace XCharts.Runtime
set { if (PropertyUtil.SetStruct(ref m_Show, value)) SetVerticesDirty(); } set { if (PropertyUtil.SetStruct(ref m_Show, value)) SetVerticesDirty(); }
} }
/// <summary> /// <summary>
/// [default:[0.5f,0.45f]]The center of ploar. The center[0] is the x-coordinate, and the center[1] is the y-coordinate. /// The center of ploar. The center[0] is the x-coordinate, and the center[1] is the y-coordinate.
/// |When value between 0 and 1 represents a percentage relative to the chart. /// When value between 0 and 1 represents a percentage relative to the chart.
/// |极坐标的中心点。数组的第一项是横坐标,第二项是纵坐标。 /// |极坐标的中心点。数组的第一项是横坐标,第二项是纵坐标。
/// 当值为0-1之间时表示百分比设置成百分比时第一项是相对于容器宽度第二项是相对于容器高度。 /// 当值为0-1之间时表示百分比设置成百分比时第一项是相对于容器宽度第二项是相对于容器高度。
/// </summary> /// </summary>
@@ -43,7 +42,7 @@ namespace XCharts.Runtime
set { if (value != null) { m_Center = value; SetAllDirty(); } } set { if (value != null) { m_Center = value; SetAllDirty(); } }
} }
/// <summary> /// <summary>
/// [default:0.35f]the radius of polar. /// the radius of polar.
/// |极坐标的半径。 /// |极坐标的半径。
/// </summary> /// </summary>
public float radius public float radius
@@ -52,7 +51,7 @@ namespace XCharts.Runtime
set { if (PropertyUtil.SetStruct(ref m_Radius, value)) SetAllDirty(); } set { if (PropertyUtil.SetStruct(ref m_Radius, value)) SetAllDirty(); }
} }
/// <summary> /// <summary>
/// [default:Color.clear]Background color of polar, which is transparent by default. /// Background color of polar, which is transparent by default.
/// |极坐标的背景色,默认透明。 /// |极坐标的背景色,默认透明。
/// </summary> /// </summary>
public Color backgroundColor public Color backgroundColor

View File

@@ -71,6 +71,9 @@ namespace XCharts.Runtime
AddComponent(component); AddComponent(component);
m_Components.Sort(); m_Components.Sort();
CreateComponentHandler(component); CreateComponentHandler(component);
#if UNITY_EDITOR && UNITY_2019_1_OR_NEWER
UnityEditor.EditorUtility.SetDirty(this);
#endif
return component; return component;
} }

View File

@@ -15,7 +15,7 @@ namespace XCharts.Runtime
this.isIgnoreBreak = ignore; this.isIgnoreBreak = ignore;
} }
} }
public class SerieContext public class SerieContext
{ {
/// <summary> /// <summary>
@@ -31,52 +31,52 @@ namespace XCharts.Runtime
/// </summary> /// </summary>
public List<int> pointerAxisDataIndexs = new List<int>(); public List<int> pointerAxisDataIndexs = new List<int>();
public bool isTriggerByAxis = false; public bool isTriggerByAxis = false;
/// <summary> /// <summary>
/// 中心点 /// 中心点
/// </summary> /// </summary>
public Vector3 center { get; internal set; } public Vector3 center;
/// <summary> /// <summary>
/// 内半径 /// 内半径
/// </summary> /// </summary>
public float insideRadius { get; set; } public float insideRadius;
/// <summary> /// <summary>
/// 外半径 /// 外半径
/// </summary> /// </summary>
public float outsideRadius { get; set; } public float outsideRadius;
/// <summary> /// <summary>
/// 最大值 /// 最大值
/// </summary> /// </summary>
public double dataMax { get; internal set; } public double dataMax;
/// <summary> /// <summary>
/// 最小值 /// 最小值
/// </summary> /// </summary>
public double dataMin { get; internal set; } public double dataMin;
public double checkValue { get; set; } public double checkValue;
/// <summary> /// <summary>
/// 左下角坐标X /// 左下角坐标X
/// </summary> /// </summary>
public float x { get; internal set; } public float x;
/// <summary> /// <summary>
/// 左下角坐标Y /// 左下角坐标Y
/// </summary> /// </summary>
public float y { get; internal set; } public float y;
/// <summary> /// <summary>
/// 宽 /// 宽
/// </summary> /// </summary>
public float width { get; internal set; } public float width;
/// <summary> /// <summary>
/// 高 /// 高
/// </summary> /// </summary>
public float height { get; internal set; } public float height;
/// <summary> /// <summary>
/// 矩形区域 /// 矩形区域
/// </summary> /// </summary>
public Rect rect { get; internal set; } public Rect rect;
/// <summary> /// <summary>
/// 绘制顶点数 /// 绘制顶点数
/// </summary> /// </summary>
public int vertCount { get; internal set; } public int vertCount;
/// <summary> /// <summary>
/// 数据对应的位置坐标。 /// 数据对应的位置坐标。
/// </summary> /// </summary>

View File

@@ -7,57 +7,56 @@ namespace XCharts.Runtime
{ {
public class SerieDataContext public class SerieDataContext
{ {
public Vector3 labelPosition { get; set; } public Vector3 labelPosition;
/// <summary> /// <summary>
/// 开始角度 /// 开始角度
/// </summary> /// </summary>
public float startAngle { get; internal set; } public float startAngle;
/// <summary> /// <summary>
/// 结束角度 /// 结束角度
/// </summary> /// </summary>
public float toAngle { get; internal set; } public float toAngle;
/// <summary> /// <summary>
/// 一半时的角度 /// 一半时的角度
/// </summary> /// </summary>
public float halfAngle { get; internal set; } public float halfAngle;
/// <summary> /// <summary>
/// 当前角度 /// 当前角度
/// </summary> /// </summary>
public float currentAngle { get; internal set; } public float currentAngle;
/// <summary> /// <summary>
/// 饼图数据项的内半径 /// 饼图数据项的内半径
/// </summary> /// </summary>
public float insideRadius { get; internal set; } public float insideRadius;
/// <summary> /// <summary>
/// 饼图数据项的偏移半径 /// 饼图数据项的偏移半径
/// </summary> /// </summary>
public float offsetRadius { get; internal set; } public float offsetRadius;
public float outsideRadius { get; set; } public float outsideRadius;
public Vector3 position { get; set; } public Vector3 position;
public List<Vector3> dataPoints = new List<Vector3>(); public List<Vector3> dataPoints = new List<Vector3>();
public List<SerieData> children = new List<SerieData>(); public List<SerieData> children = new List<SerieData>();
/// <summary> /// <summary>
/// 绘制区域。 /// 绘制区域。
/// </summary> /// </summary>
public Rect rect { get; set; } public Rect rect;
public Rect subRect { get; set; } public Rect subRect;
public int level { get; set; } public int level;
public SerieData parent { get; set; } public SerieData parent;
public Color32 color { get; set; } public Color32 color;
public double area { get; set; } public double area;
public float angle { get; set; } public float angle;
public Vector3 offsetCenter { get; set; } public Vector3 offsetCenter;
public float stackHeight { get; set; } public float stackHeight;
public bool isClip { get; set; } public bool isClip;
public bool canShowLabel = true; public bool canShowLabel = true;
public Image symbol { get; set; } public Image symbol;
/// <summary> /// <summary>
/// Whether the data item is highlighted. /// Whether the data item is highlighted.
/// |该数据项是否被高亮,一般由鼠标悬停或图例悬停触发高亮。 /// |该数据项是否被高亮,一般由鼠标悬停或图例悬停触发高亮。
/// </summary> /// </summary>
public bool highlight { get; set; } public bool highlight;
} }
} }