2019-09-19 19:26:05 +08:00
|
|
|
using System;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
2022-02-19 22:37:57 +08:00
|
|
|
namespace XCharts.Runtime
|
2019-09-19 19:26:05 +08:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Serializable]
|
2021-12-28 08:18:24 +08:00
|
|
|
public class LineArrow : ChildComponent, ISerieExtraComponent
|
2019-09-19 19:26:05 +08:00
|
|
|
{
|
|
|
|
|
public enum Position
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 末端箭头
|
|
|
|
|
/// </summary>
|
|
|
|
|
End,
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 头端箭头
|
|
|
|
|
/// </summary>
|
|
|
|
|
Start
|
|
|
|
|
}
|
2022-05-22 22:17:38 +08:00
|
|
|
|
2019-09-19 19:26:05 +08:00
|
|
|
[SerializeField] private bool m_Show;
|
2022-03-26 21:34:38 +08:00
|
|
|
[SerializeField] private Position m_Position;
|
2021-01-11 08:54:28 +08:00
|
|
|
[SerializeField]
|
2021-11-23 13:20:07 +08:00
|
|
|
private ArrowStyle m_Arrow = new ArrowStyle()
|
2021-01-11 08:54:28 +08:00
|
|
|
{
|
|
|
|
|
width = 10,
|
|
|
|
|
height = 15,
|
|
|
|
|
offset = 0,
|
|
|
|
|
dent = 3
|
|
|
|
|
};
|
2019-09-19 19:26:05 +08:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Whether to show the arrow.
|
2022-03-24 08:37:06 +08:00
|
|
|
/// |是否显示箭头。
|
2019-09-19 19:26:05 +08:00
|
|
|
/// </summary>
|
2020-03-05 20:25:19 +08:00
|
|
|
public bool show
|
|
|
|
|
{
|
|
|
|
|
get { return m_Show; }
|
2021-01-11 08:54:28 +08:00
|
|
|
set { if (PropertyUtil.SetStruct(ref m_Show, value)) SetVerticesDirty(); }
|
2020-03-05 20:25:19 +08:00
|
|
|
}
|
2019-09-19 19:26:05 +08:00
|
|
|
/// <summary>
|
|
|
|
|
/// The position of arrow.
|
2022-03-24 08:37:06 +08:00
|
|
|
/// |箭头位置。
|
2019-09-19 19:26:05 +08:00
|
|
|
/// </summary>
|
2020-03-05 20:25:19 +08:00
|
|
|
public Position position
|
|
|
|
|
{
|
|
|
|
|
get { return m_Position; }
|
2021-01-11 08:54:28 +08:00
|
|
|
set { if (PropertyUtil.SetStruct(ref m_Position, value)) SetVerticesDirty(); }
|
2020-03-05 20:25:19 +08:00
|
|
|
}
|
2021-01-11 08:54:28 +08:00
|
|
|
|
2019-09-19 19:26:05 +08:00
|
|
|
/// <summary>
|
2021-01-11 08:54:28 +08:00
|
|
|
/// the arrow of line.
|
2022-03-24 08:37:06 +08:00
|
|
|
/// |箭头。
|
2019-09-19 19:26:05 +08:00
|
|
|
/// </summary>
|
2021-11-23 13:20:07 +08:00
|
|
|
public ArrowStyle arrow
|
2020-03-05 20:25:19 +08:00
|
|
|
{
|
2021-01-11 08:54:28 +08:00
|
|
|
get { return m_Arrow; }
|
|
|
|
|
set { if (PropertyUtil.SetClass(ref m_Arrow, value)) SetVerticesDirty(); }
|
2020-03-05 20:25:19 +08:00
|
|
|
}
|
2019-09-19 19:26:05 +08:00
|
|
|
}
|
|
|
|
|
}
|