mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-08-20 09:34:42 -05:00
add disposed check
This commit is contained in:
@@ -19,6 +19,7 @@ namespace UniVRM10.FastSpringBones.System
|
||||
public NativeArray<BlittableLogic> Logics { get; }
|
||||
public NativeArray<BlittableTransform> BlittableTransforms { get; }
|
||||
public Transform[] Transforms { get; }
|
||||
public bool IsDisposed { get; private set; }
|
||||
|
||||
public FastSpringBoneBuffer(IReadOnlyList<FastSpringBoneSpring> springs)
|
||||
{
|
||||
@@ -132,6 +133,8 @@ namespace UniVRM10.FastSpringBones.System
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (IsDisposed) return;
|
||||
IsDisposed = true;
|
||||
Springs.Dispose();
|
||||
Joints.Dispose();
|
||||
BlittableTransforms.Dispose();
|
||||
|
||||
@@ -75,6 +75,7 @@ namespace UniVRM10.FastSpringBones.System
|
||||
var logicsIndex = 0;
|
||||
foreach (var buffer in _batchedBuffers)
|
||||
{
|
||||
if(buffer.IsDisposed) continue;
|
||||
var length = buffer.Logics.Length;
|
||||
NativeArray<BlittableLogic>.Copy(_logics, logicsIndex, buffer.Logics, 0, length);
|
||||
logicsIndex += length;
|
||||
|
||||
Reference in New Issue
Block a user