No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SerieEventDataPool.cs 870B

123456789101112131415161718192021222324252627282930313233
  1. using UnityEngine;
  2. namespace XCharts.Runtime
  3. {
  4. public static class SerieEventDataPool
  5. {
  6. private static readonly ObjectPool<SerieEventData> s_ListPool = new ObjectPool<SerieEventData>(null, OnClear);
  7. static void OnGet(SerieEventData data)
  8. {
  9. }
  10. static void OnClear(SerieEventData data)
  11. {
  12. data.Reset();
  13. }
  14. public static SerieEventData Get(Vector3 pos, int serieIndex, int dataIndex, int dimension, double value)
  15. {
  16. var data = s_ListPool.Get();
  17. data.serieIndex = serieIndex;
  18. data.dataIndex = dataIndex;
  19. data.pointerPos = pos;
  20. data.dimension = dimension;
  21. return data;
  22. }
  23. public static void Release(SerieEventData toRelease)
  24. {
  25. s_ListPool.Release(toRelease);
  26. }
  27. }
  28. }