2024-03-05 17:34:41 +08:00
|
|
|
#if GRIFFIN
|
2023-12-30 17:37:48 +08:00
|
|
|
using UnityEngine;
|
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using Unity.Collections;
|
|
|
|
|
|
|
|
namespace Pinwheel.Griffin
|
|
|
|
{
|
|
|
|
public static class GNativeArrayUtilities
|
|
|
|
{
|
|
|
|
public static void Dispose<T>(NativeArray<T> array) where T : struct
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
if (array.IsCreated)
|
|
|
|
{
|
|
|
|
array.Dispose();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (System.InvalidOperationException)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-03-05 17:34:41 +08:00
|
|
|
#endif
|