Files
XCharts/Runtime/Component/Sub/LineArrow.cs

69 lines
1.8 KiB
C#
Raw Normal View History

2021-01-11 08:54:28 +08:00
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
2019-09-19 19:26:05 +08:00
using System;
using UnityEngine;
namespace XCharts
{
/// <summary>
/// </summary>
[Serializable]
2019-10-14 18:13:08 +08:00
public class LineArrow : SubComponent
2019-09-19 19:26:05 +08:00
{
public enum Position
{
/// <summary>
/// 末端箭头
/// </summary>
End,
/// <summary>
/// 头端箭头
/// </summary>
Start
}
[SerializeField] private bool m_Show;
[SerializeField] Position m_Position;
2021-01-11 08:54:28 +08:00
[SerializeField]
private Arrow m_Arrow = new Arrow()
{
width = 10,
height = 15,
offset = 0,
dent = 3
};
2019-09-19 19:26:05 +08:00
/// <summary>
/// Whether to show the arrow.
/// 是否显示箭头。
/// </summary>
public bool show
{
get { return m_Show; }
2021-01-11 08:54:28 +08:00
set { if (PropertyUtil.SetStruct(ref m_Show, value)) SetVerticesDirty(); }
}
2019-09-19 19:26:05 +08:00
/// <summary>
/// The position of arrow.
/// 箭头位置。
/// </summary>
public Position position
{
get { return m_Position; }
2021-01-11 08:54:28 +08:00
set { if (PropertyUtil.SetStruct(ref m_Position, value)) SetVerticesDirty(); }
}
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.
/// 箭头。
2019-09-19 19:26:05 +08:00
/// </summary>
2021-01-11 08:54:28 +08:00
public Arrow arrow
{
2021-01-11 08:54:28 +08:00
get { return m_Arrow; }
set { if (PropertyUtil.SetClass(ref m_Arrow, value)) SetVerticesDirty(); }
}
2019-09-19 19:26:05 +08:00
}
}