private void ReleaseBuffers() { if (_transformAccessArray.isCreated) { _transformAccessArray.Dispose(); } if (_transformPointers != null) { UnsafeUtility.Free(_transformPointers, Allocator.Persistent); _transformPointers = null; } }
private void ReconstructBuffers() { ReleaseBuffers(); var transforms = Targets; _transformPointers = (BlittableTransform **)UnsafeUtility.Malloc( sizeof(BlittableTransform *) * transforms.Count, 16, Allocator.Persistent ); _transformAccessArray = new TransformAccessArray(transforms.Count); for (var i = 0; i < transforms.Count; i++) { _transformPointers[i] = transforms[i].GetUnsafePtr(); _transformAccessArray.Add(transforms[i].Transform); } }