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)
return;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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