Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[0.x][springbone] ColliderGroups null check #2471

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 23 additions & 20 deletions Assets/VRM/Runtime/SpringBone/Jobs/FastSpringBoneReplacer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,34 @@ public static async Task<FastSpringBoneBuffer> MakeBufferAsync(GameObject root,
{
var component = components[i];
var colliders = new List<FastSpringBoneCollider>();
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);
}
}
}

Expand Down
Loading