mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-25 02:10:16 +00:00
增加UI组件支持
This commit is contained in:
53
Runtime/Internal/UIComponentTheme.cs
Normal file
53
Runtime/Internal/UIComponentTheme.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace XCharts.Runtime
|
||||
{
|
||||
[Serializable]
|
||||
public class UIComponentTheme : ChildComponent
|
||||
{
|
||||
[SerializeField] private bool m_Show = true;
|
||||
[SerializeField] private Theme m_SharedTheme;
|
||||
[SerializeField] private bool m_TransparentBackground = false;
|
||||
|
||||
public bool show { get { return m_Show; } }
|
||||
/// <summary>
|
||||
/// the theme of chart.
|
||||
/// |主题类型。
|
||||
/// </summary>
|
||||
public ThemeType themeType
|
||||
{
|
||||
get { return sharedTheme.themeType; }
|
||||
}
|
||||
/// <summary>
|
||||
/// theme name.
|
||||
/// |主题名字。
|
||||
/// </summary>
|
||||
public string themeName
|
||||
{
|
||||
get { return sharedTheme.themeName; }
|
||||
}
|
||||
/// <summary>
|
||||
/// the asset of theme.
|
||||
/// |主题配置。
|
||||
/// </summary>
|
||||
public Theme sharedTheme
|
||||
{
|
||||
get { return m_SharedTheme; }
|
||||
set { m_SharedTheme = value; SetAllDirty(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// the background color of chart.
|
||||
/// |背景颜色。
|
||||
/// </summary>
|
||||
public Color32 backgroundColor
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_TransparentBackground) return ColorUtil.clearColor32;
|
||||
else return sharedTheme.backgroundColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user