From 67fd767d29caf155b43cdd2cafb866f3d9e99cc7 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Tue, 22 Oct 2024 15:46:54 +0900 Subject: [PATCH] null check --- .../SpringBone/Jobs/FastSpringBoneReplacer.cs | 45 ++++++++++--------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/Assets/VRM/Runtime/SpringBone/Jobs/FastSpringBoneReplacer.cs b/Assets/VRM/Runtime/SpringBone/Jobs/FastSpringBoneReplacer.cs index 85f6cda90..71c5d39f1 100644 --- a/Assets/VRM/Runtime/SpringBone/Jobs/FastSpringBoneReplacer.cs +++ b/Assets/VRM/Runtime/SpringBone/Jobs/FastSpringBoneReplacer.cs @@ -22,31 +22,34 @@ namespace VRM.SpringBoneJobs { 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) + foreach (var group in component.ColliderGroups) { - await awaitCaller.NextFrame(); - token.ThrowIfCancellationRequested(); - } - - foreach (var collider in group.Colliders) - { - if (collider == null) continue; - - var c = new FastSpringBoneCollider + if (group == null) continue; + if (awaitCaller != null) { - Transform = group.transform, - Collider = new BlittableCollider + await awaitCaller.NextFrame(); + token.ThrowIfCancellationRequested(); + } + + foreach (var collider in group.Colliders) + { + 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); + } } }