2021-01-11 08:54:28 +08:00
|
|
|
|
/************************************************/
|
|
|
|
|
|
/* */
|
|
|
|
|
|
/* Copyright (c) 2018 - 2021 monitor1394 */
|
|
|
|
|
|
/* https://github.com/monitor1394 */
|
|
|
|
|
|
/* */
|
|
|
|
|
|
/************************************************/
|
2019-11-30 21:24:04 +08:00
|
|
|
|
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
|
|
namespace XCharts
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Settings related to gauge pointer.
|
|
|
|
|
|
/// 仪表盘指针相关设置。
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[System.Serializable]
|
|
|
|
|
|
public class GaugePointer : SubComponent
|
|
|
|
|
|
{
|
|
|
|
|
|
[SerializeField] private bool m_Show = true;
|
|
|
|
|
|
[SerializeField] private float m_Length = 0.8f;
|
|
|
|
|
|
[SerializeField] private float m_Width = 15;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2020-07-17 08:52:32 +08:00
|
|
|
|
/// Whether to display a pointer.
|
2019-11-30 21:24:04 +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-11-30 21:24:04 +08:00
|
|
|
|
/// <summary>
|
2020-07-17 08:52:32 +08:00
|
|
|
|
/// Pointer length. It can be an absolute value, or it can be a percentage relative to the radius (0-1).
|
|
|
|
|
|
/// 指针长度。可以是绝对值,也可以是相对于半径的百分比(0-1的浮点数)。
|
2019-11-30 21:24:04 +08:00
|
|
|
|
/// </summary>
|
2020-03-05 20:25:19 +08:00
|
|
|
|
public float length
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_Length; }
|
2021-01-11 08:54:28 +08:00
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_Length, value)) SetVerticesDirty(); }
|
2020-03-05 20:25:19 +08:00
|
|
|
|
}
|
2019-11-30 21:24:04 +08:00
|
|
|
|
/// <summary>
|
2020-07-17 08:52:32 +08:00
|
|
|
|
/// Pointer width.
|
2019-11-30 21:24:04 +08:00
|
|
|
|
/// 指针宽度。
|
|
|
|
|
|
/// </summary>
|
2020-03-05 20:25:19 +08:00
|
|
|
|
public float width
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return m_Width; }
|
2021-01-11 08:54:28 +08:00
|
|
|
|
set { if (PropertyUtil.SetStruct(ref m_Width, value)) SetVerticesDirty(); }
|
2020-03-05 20:25:19 +08:00
|
|
|
|
}
|
2019-11-30 21:24:04 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|