XChart重构:共享数据模型快照、时间序列与多分辨率系列,伪3D散点图/雷达图接入共享数据

This commit is contained in:
2026-08-31 08:29:42 +08:00
parent 48ef51d169
commit 216d157472
28 changed files with 3188 additions and 144 deletions
+19 -5
View File
@@ -15,9 +15,11 @@ namespace XericUI.XChart
[Header("工具管理")]
[SerializeField] private bool m_ShowDebug;
[SerializeField] private bool m_HideAllTools;
[SerializeField] private XChartDataModel m_DataModel = new XChartDataModel();
public XChartToolsManager ToolManager { get; private set; }
public Transform ToolsRoot { get; private set; }
public XChartDataModel DataModel => m_DataModel;
private bool m_IsInitialized;
@@ -48,10 +50,21 @@ namespace XericUI.XChart
var flags = CurrentFlags;
var toolsObj = new GameObject("[XChartTools]");
toolsObj.transform.SetParent(transform, false);
toolsObj.hideFlags = flags;
ToolsRoot = toolsObj.transform;
var toolsRoot = transform.Find("[XChartTools]") as RectTransform;
if (toolsRoot == null)
{
var toolsObj = new GameObject("[XChartTools]", typeof(RectTransform));
toolsRoot = toolsObj.GetComponent<RectTransform>();
toolsRoot.SetParent(transform, false);
}
toolsRoot.anchorMin = Vector2.zero;
toolsRoot.anchorMax = Vector2.one;
toolsRoot.offsetMin = Vector2.zero;
toolsRoot.offsetMax = Vector2.zero;
toolsRoot.pivot = new Vector2(0.5f, 0.5f);
toolsRoot.gameObject.hideFlags = flags;
ToolsRoot = toolsRoot;
ToolManager = new XChartToolsManager
{
@@ -94,6 +107,7 @@ namespace XericUI.XChart
protected virtual void OnDestroy()
{
m_DataModel?.DisposeRuntime();
if (ToolManager != null)
{
ToolManager.Dispose();
@@ -115,4 +129,4 @@ namespace XericUI.XChart
// 由派生类按需扩展
}
}
}
}