XCharts 2.0

This commit is contained in:
monitor1394
2021-01-11 08:54:28 +08:00
parent ed8d0687f7
commit 489095865d
304 changed files with 14799 additions and 12503 deletions

View File

@@ -1,9 +1,9 @@
/******************************************/
/* */
/* Copyright (c) 2018 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/******************************************/
/************************************************/
/* */
/* Copyright (c) 2018 - 2021 monitor1394 */
/* https://github.com/monitor1394 */
/* */
/************************************************/
using UnityEngine;
using System;
@@ -19,9 +19,9 @@ namespace XCharts
{
[SerializeField] private bool m_Show = true;
[SerializeField] private string m_Text;
[SerializeField] private TextStyle m_TextStyle = new TextStyle(16);
[SerializeField] private TextStyle m_TextStyle = new TextStyle();
[SerializeField] private string m_SubText;
[SerializeField] private TextStyle m_SubTextStyle = new TextStyle(14);
[SerializeField] private TextStyle m_SubTextStyle = new TextStyle();
[SerializeField] private float m_ItemGap = 8;
[SerializeField] private Location m_Location = Location.defaultTop;
@@ -30,19 +30,12 @@ namespace XCharts
/// Set this to false to prevent the title from showing.
/// 是否显示标题组件。
/// </summary>
public bool show { get { return m_Show; } set { if (PropertyUtility.SetStruct(ref m_Show, value)) SetComponentDirty(); } }
public bool show { get { return m_Show; } set { if (PropertyUtil.SetStruct(ref m_Show, value)) SetComponentDirty(); } }
/// <summary>
/// The main title text, supporting \n for newlines.
/// 主标题文本,支持使用 \n 换行。
/// </summary>
public string text { get { return m_Text; } set { if (PropertyUtility.SetClass(ref m_Text, value)) SetComponentDirty(); } }
/// <summary>
/// [default:16]
/// main title font size.
/// 主标题文字的字体大小。
/// </summary>
[Obsolete("use textStyle instead.", true)]
public int textFontSize { get { return m_TextStyle.fontSize; } set { m_TextStyle.fontSize = value; } }
public string text { get { return m_Text; } set { if (PropertyUtil.SetClass(ref m_Text, value)) SetComponentDirty(); } }
/// <summary>
/// The text style of main title.
/// 主标题文本样式。
@@ -50,7 +43,7 @@ namespace XCharts
public TextStyle textStyle
{
get { return m_TextStyle; }
set { if (PropertyUtility.SetClass(ref m_TextStyle, value)) SetComponentDirty(); }
set { if (PropertyUtil.SetClass(ref m_TextStyle, value)) SetComponentDirty(); }
}
/// <summary>
/// Subtitle text, supporting for \n for newlines.
@@ -59,7 +52,7 @@ namespace XCharts
public string subText
{
get { return m_SubText; }
set { if (PropertyUtility.SetClass(ref m_SubText, value)) SetComponentDirty(); }
set { if (PropertyUtil.SetClass(ref m_SubText, value)) SetComponentDirty(); }
}
/// <summary>
/// The text style of sub title.
@@ -68,18 +61,7 @@ namespace XCharts
public TextStyle subTextStyle
{
get { return m_SubTextStyle; }
set { if (PropertyUtility.SetClass(ref m_SubTextStyle, value)) SetComponentDirty(); }
}
/// <summary>
/// [default:14]
/// subtitle font size.
/// 副标题文字的字体大小。
/// </summary>
[Obsolete("use subTextStyle instead.", true)]
public int subTextFontSize
{
get { return m_SubTextStyle.fontSize; }
set { m_SubTextStyle.fontSize = value; }
set { if (PropertyUtil.SetClass(ref m_SubTextStyle, value)) SetComponentDirty(); }
}
/// <summary>
/// [default:8]
@@ -89,7 +71,7 @@ namespace XCharts
public float itemGap
{
get { return m_ItemGap; }
set { if (PropertyUtility.SetStruct(ref m_ItemGap, value)) SetComponentDirty(); }
set { if (PropertyUtil.SetStruct(ref m_ItemGap, value)) SetComponentDirty(); }
}
/// <summary>
/// The location of title component.
@@ -98,9 +80,11 @@ namespace XCharts
public Location location
{
get { return m_Location; }
set { if (PropertyUtility.SetClass(ref m_Location, value)) SetComponentDirty(); }
set { if (PropertyUtil.SetClass(ref m_Location, value)) SetComponentDirty(); }
}
public int index { get; internal set; }
public override bool vertsDirty { get { return false; } }
public override bool componentDirty
{
@@ -123,10 +107,10 @@ namespace XCharts
{
m_Show = true,
m_Text = "Chart Title",
m_TextStyle = new TextStyle(16),
m_TextStyle = new TextStyle(),
m_SubText = "",
m_SubTextStyle = new TextStyle(14),
m_ItemGap = 8,
m_SubTextStyle = new TextStyle(),
m_ItemGap = 0,
m_Location = Location.defaultTop
};
return title;