拼ui 一些业务逻辑x实现

This commit is contained in:
FloatGaming
2026-03-19 06:15:09 +08:00
parent f5c6f143c0
commit 49e45ac464
1118 changed files with 246518 additions and 5368 deletions
@@ -0,0 +1,40 @@
using System.Collections.Generic;
using UnityEngine;
using EasyChart.Layers;
namespace EasyChart
{
public sealed class DefaultChartHitTestPolicy : IChartHitTestPolicy
{
public static readonly DefaultChartHitTestPolicy Instance = new DefaultChartHitTestPolicy();
private DefaultChartHitTestPolicy() { }
public bool TryBuildTooltipItems(
TooltipContext context,
IList<BaseSeriesRenderer> renderers,
List<TooltipItem> items,
ref Vector2? cursorPosition,
ref string categoryLabel)
{
if (renderers == null || items == null) return false;
bool exclusiveHit = false;
for (int i = renderers.Count - 1; i >= 0; i--)
{
var renderer = renderers[i];
if (renderer == null) continue;
bool hit = renderer.GetTooltip(context, items, ref cursorPosition, ref categoryLabel);
if (hit && renderer is IExclusiveTooltipRenderer)
{
exclusiveHit = true;
}
if (exclusiveHit) break;
}
return items.Count > 0;
}
}
}