mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-25 18:30:14 +00:00
XCharts 2.0
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
/******************************************/
|
||||
/* */
|
||||
/* Copyright (c) 2018 monitor1394 */
|
||||
/* https://github.com/monitor1394 */
|
||||
/* */
|
||||
/******************************************/
|
||||
/************************************************/
|
||||
/* */
|
||||
/* Copyright (c) 2018 - 2021 monitor1394 */
|
||||
/* https://github.com/monitor1394 */
|
||||
/* */
|
||||
/************************************************/
|
||||
|
||||
using System;
|
||||
using UnityEngine;
|
||||
@@ -30,11 +30,7 @@ namespace XCharts
|
||||
[SerializeField] private bool m_Show;
|
||||
[SerializeField] private string m_Name;
|
||||
[SerializeField] private Location m_Location;
|
||||
[SerializeField] private Vector2 m_Offset;
|
||||
[SerializeField] private float m_Rotate;
|
||||
[SerializeField] private Color m_Color;
|
||||
[SerializeField] private int m_FontSize;
|
||||
[SerializeField] private FontStyle m_FontStyle;
|
||||
[SerializeField] private TextStyle m_TextStyle = new TextStyle();
|
||||
|
||||
/// <summary>
|
||||
/// Whether to show axis name.
|
||||
@@ -43,7 +39,7 @@ namespace XCharts
|
||||
public bool show
|
||||
{
|
||||
get { return m_Show; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Show, value)) SetComponentDirty(); }
|
||||
set { if (PropertyUtil.SetStruct(ref m_Show, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the name of axis.
|
||||
@@ -52,7 +48,7 @@ namespace XCharts
|
||||
public string name
|
||||
{
|
||||
get { return m_Name; }
|
||||
set { if (PropertyUtility.SetClass(ref m_Name, value)) SetComponentDirty(); }
|
||||
set { if (PropertyUtil.SetClass(ref m_Name, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// Location of axis name.
|
||||
@@ -61,52 +57,17 @@ namespace XCharts
|
||||
public Location location
|
||||
{
|
||||
get { return m_Location; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Location, value)) SetComponentDirty(); }
|
||||
set { if (PropertyUtil.SetStruct(ref m_Location, value)) SetComponentDirty(); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// the offset of axis name and axis line.
|
||||
/// 坐标轴名称与轴线之间的偏移。
|
||||
/// The text style of axis name.
|
||||
/// 文本样式。
|
||||
/// </summary>
|
||||
public Vector2 offset
|
||||
public TextStyle textStyle
|
||||
{
|
||||
get { return m_Offset; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Offset, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// Rotation of axis name.
|
||||
/// 坐标轴名字旋转,角度值。
|
||||
/// </summary>
|
||||
public float rotate
|
||||
{
|
||||
get { return m_Rotate; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_Rotate, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// Color of axis name.
|
||||
/// 坐标轴名称的文字颜色。
|
||||
/// </summary>
|
||||
public Color color
|
||||
{
|
||||
get { return m_Color; }
|
||||
set { if (PropertyUtility.SetColor(ref m_Color, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// axis name font size.
|
||||
/// 坐标轴名称的文字大小。
|
||||
/// </summary>
|
||||
public int fontSize
|
||||
{
|
||||
get { return m_FontSize; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_FontSize, value)) SetComponentDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// axis name font style.
|
||||
/// 坐标轴名称的文字风格。
|
||||
/// </summary>
|
||||
public FontStyle fontStyle
|
||||
{
|
||||
get { return m_FontStyle; }
|
||||
set { if (PropertyUtility.SetStruct(ref m_FontStyle, value)) SetComponentDirty(); }
|
||||
get { return m_TextStyle; }
|
||||
set { if (PropertyUtil.SetClass(ref m_TextStyle, value)) SetComponentDirty(); }
|
||||
}
|
||||
|
||||
public static AxisName defaultAxisName
|
||||
@@ -118,10 +79,7 @@ namespace XCharts
|
||||
m_Show = false,
|
||||
m_Name = "axisName",
|
||||
m_Location = Location.End,
|
||||
m_Rotate = 0,
|
||||
m_Color = Color.clear,
|
||||
m_FontSize = 18,
|
||||
m_FontStyle = FontStyle.Normal
|
||||
m_TextStyle = new TextStyle(),
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -132,11 +90,7 @@ namespace XCharts
|
||||
axisName.show = show;
|
||||
axisName.name = name;
|
||||
axisName.location = location;
|
||||
axisName.offset = offset;
|
||||
axisName.rotate = rotate;
|
||||
axisName.color = color;
|
||||
axisName.fontSize = fontSize;
|
||||
axisName.fontStyle = fontStyle;
|
||||
axisName.textStyle.Copy(textStyle);
|
||||
return axisName;
|
||||
}
|
||||
|
||||
@@ -145,11 +99,7 @@ namespace XCharts
|
||||
show = axisName.show;
|
||||
name = axisName.name;
|
||||
location = axisName.location;
|
||||
offset = axisName.offset;
|
||||
rotate = axisName.rotate;
|
||||
color = axisName.color;
|
||||
fontSize = axisName.fontSize;
|
||||
fontStyle = axisName.fontStyle;
|
||||
textStyle.Copy(axisName.textStyle);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user