mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-02-19 20:55:09 +08:00
fix: build fails when entries in the bones array are null (#682)
* fix: build fails when entries in the bones array are null * chore: skip bone remapping when no Scale Adjusters are in use
This commit is contained in:
parent
f6a2da8b8d
commit
d26ac60be5
@ -33,12 +33,17 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
UnityEngine.Object.DestroyImmediate(sar.gameObject);
|
||||
}
|
||||
|
||||
if (boneMappings.Count == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var smr in context.AvatarRootObject.GetComponentsInChildren<SkinnedMeshRenderer>())
|
||||
{
|
||||
var bones = smr.bones;
|
||||
for (int i = 0; i < bones.Length; i++)
|
||||
{
|
||||
if (boneMappings.TryGetValue(bones[i], out var newBone))
|
||||
if (bones[i] != null && boneMappings.TryGetValue(bones[i], out var newBone))
|
||||
{
|
||||
bones[i] = newBone;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user