调整UI组件相关代码

This commit is contained in:
monitor1394
2024-01-16 22:29:15 +08:00
parent 6aa11249c5
commit daec83c4a5
12 changed files with 223 additions and 65 deletions

View File

@@ -17,6 +17,8 @@ namespace XCharts.Runtime
[SerializeField] private Sprite m_Image;
[SerializeField] private Image.Type m_ImageType;
[SerializeField] private Color m_ImageColor = Color.white;
[SerializeField][Since("v3.10.0")] private float m_ImageWidth = 0;
[SerializeField][Since("v3.10.0")] private float m_ImageHeight = 0;
[SerializeField] private bool m_AutoColor = true;
[SerializeField][Since("v3.10.0")] private BorderStyle m_BorderStyle = new BorderStyle();
@@ -58,6 +60,26 @@ namespace XCharts.Runtime
set { if (PropertyUtil.SetColor(ref m_ImageColor, value)) SetComponentDirty(); }
}
/// <summary>
/// the width of background image.
/// ||背景图宽度。
/// </summary>
public float imageWidth
{
get { return m_ImageWidth; }
set { if (PropertyUtil.SetStruct(ref m_ImageWidth, value)) SetComponentDirty(); }
}
/// <summary>
/// the height of background image.
/// ||背景图高度。
/// </summary>
public float imageHeight
{
get { return m_ImageHeight; }
set { if (PropertyUtil.SetStruct(ref m_ImageHeight, value)) SetComponentDirty(); }
}
/// <summary>
/// Whether to use theme background color for component color when the background component is on.
/// ||当background组件开启时是否自动使用主题背景色作为backgrounnd组件的颜色。当设置为false时用imageColor作为颜色。