diff --git a/Assets/VRM/Runtime/SpringBone/Jobs/FastSpringBoneReplacer.cs b/Assets/VRM/Runtime/SpringBone/Jobs/FastSpringBoneReplacer.cs index 85f6cda90f..71c5d39f1d 100644 --- a/Assets/VRM/Runtime/SpringBone/Jobs/FastSpringBoneReplacer.cs +++ b/Assets/VRM/Runtime/SpringBone/Jobs/FastSpringBoneReplacer.cs @@ -22,31 +22,34 @@ public static async Task MakeBufferAsync(GameObject root, { var component = components[i]; var colliders = new List(); - foreach (var group in component.ColliderGroups) + if (component.ColliderGroups != null) { - if (group == null) continue; - if (awaitCaller != null) - { - await awaitCaller.NextFrame(); - token.ThrowIfCancellationRequested(); - } - - foreach (var collider in group.Colliders) + foreach (var group in component.ColliderGroups) { - if (collider == null) continue; + if (group == null) continue; + if (awaitCaller != null) + { + await awaitCaller.NextFrame(); + token.ThrowIfCancellationRequested(); + } - var c = new FastSpringBoneCollider + foreach (var collider in group.Colliders) { - Transform = group.transform, - Collider = new BlittableCollider + if (collider == null) continue; + + var c = new FastSpringBoneCollider { - offset = collider.Offset, - radius = collider.Radius, - tailOrNormal = default, - colliderType = BlittableColliderType.Sphere - } - }; - colliders.Add(c); + Transform = group.transform, + Collider = new BlittableCollider + { + offset = collider.Offset, + radius = collider.Radius, + tailOrNormal = default, + colliderType = BlittableColliderType.Sphere + } + }; + colliders.Add(c); + } } }