mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-20 23:40:10 +00:00
完善SerieSymbol以支持象形柱图PictorialBarChart扩展
This commit is contained in:
@@ -163,7 +163,7 @@ namespace XCharts
|
||||
foreach (var draw in m_ComponentHandlers) draw.Update();
|
||||
}
|
||||
|
||||
internal Painter GetPainter(int index)
|
||||
public Painter GetPainter(int index)
|
||||
{
|
||||
if (index >= 0 && index < m_PainterList.Count)
|
||||
{
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace XCharts
|
||||
protected Vector2 graphAnchorMax { get { return m_GraphMinAnchor; } }
|
||||
protected Vector2 graphAnchorMin { get { return m_GraphMaxAnchor; } }
|
||||
protected Vector2 graphPivot { get { return m_GraphPivot; } }
|
||||
internal HideFlags chartHideFlags { get { return m_DebugMode ? HideFlags.None : HideFlags.HideInHierarchy; } }
|
||||
public HideFlags chartHideFlags { get { return m_DebugMode ? HideFlags.None : HideFlags.HideInHierarchy; } }
|
||||
|
||||
private ScrollRect m_ScrollRect;
|
||||
|
||||
|
||||
@@ -387,7 +387,8 @@ namespace XCharts
|
||||
return ChartHelper.GetOrAddComponent<Painter>(painterObj);
|
||||
}
|
||||
|
||||
public static Image AddIcon(string name, Transform parent, float width, float height)
|
||||
public static Image AddIcon(string name, Transform parent, float width, float height, Sprite sprite = null,
|
||||
Image.Type type = Image.Type.Simple)
|
||||
{
|
||||
var anchorMax = new Vector2(0.5f, 0.5f);
|
||||
var anchorMin = new Vector2(0.5f, 0.5f);
|
||||
@@ -396,6 +397,15 @@ namespace XCharts
|
||||
GameObject iconObj = AddObject(name, parent, anchorMin, anchorMax, pivot, sizeDelta);
|
||||
var img = GetOrAddComponent<Image>(iconObj);
|
||||
img.raycastTarget = false;
|
||||
img.type = type;
|
||||
if (sprite != null)
|
||||
{
|
||||
img.sprite = sprite;
|
||||
if (width == 0 || height == 0)
|
||||
{
|
||||
img.SetNativeSize();
|
||||
}
|
||||
}
|
||||
return img;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user