mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-20 07:20:08 +00:00
3.0 - unitypackage
This commit is contained in:
29
Runtime/Internal/Pools/SerieDataPool.cs
Normal file
29
Runtime/Internal/Pools/SerieDataPool.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
using UnityEngine;
|
||||
|
||||
namespace XCharts
|
||||
{
|
||||
internal static class SerieDataPool
|
||||
{
|
||||
private static readonly ObjectPool<SerieData> s_ListPool = new ObjectPool<SerieData>(null, OnClear);
|
||||
|
||||
static void OnGet(SerieData serieData)
|
||||
{
|
||||
}
|
||||
|
||||
static void OnClear(SerieData serieData)
|
||||
{
|
||||
serieData.Reset();
|
||||
}
|
||||
|
||||
public static SerieData Get()
|
||||
{
|
||||
return s_ListPool.Get();
|
||||
}
|
||||
|
||||
public static void Release(SerieData toRelease)
|
||||
{
|
||||
s_ListPool.Release(toRelease);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user