mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2024-12-29 02:35:06 +08:00
fix: BoneProxy target couldn't be empty after assigned (#1192)
This commit is contained in:
parent
032e7a692e
commit
8e49df703f
@ -95,7 +95,7 @@ namespace nadena.dev.modular_avatar.core.editor
|
|||||||
var t = (ModularAvatarBoneProxy) targets[i];
|
var t = (ModularAvatarBoneProxy) targets[i];
|
||||||
Undo.RecordObjects(targets, "Set targets");
|
Undo.RecordObjects(targets, "Set targets");
|
||||||
var xform = ((TempObjRef) objRefs[i]).target;
|
var xform = ((TempObjRef) objRefs[i]).target;
|
||||||
if (RuntimeUtil.FindAvatarTransformInParents(xform)?.gameObject != parentAvatar) continue;
|
if (xform != null && RuntimeUtil.FindAvatarTransformInParents(xform)?.gameObject != parentAvatar) continue;
|
||||||
t.target = xform;
|
t.target = xform;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -159,4 +159,4 @@ namespace nadena.dev.modular_avatar.core.editor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -205,6 +205,13 @@ namespace nadena.dev.modular_avatar.core
|
|||||||
|
|
||||||
Transform iter = newTarget;
|
Transform iter = newTarget;
|
||||||
|
|
||||||
|
if (newTarget == null)
|
||||||
|
{
|
||||||
|
boneReference = HumanBodyBones.LastBone;
|
||||||
|
subPath = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (newTarget == avatarTransform)
|
if (newTarget == avatarTransform)
|
||||||
{
|
{
|
||||||
boneReference = HumanBodyBones.LastBone;
|
boneReference = HumanBodyBones.LastBone;
|
||||||
@ -230,4 +237,4 @@ namespace nadena.dev.modular_avatar.core
|
|||||||
_targetCache = newTarget;
|
_targetCache = newTarget;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user