mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-01-31 02:32:53 +08:00
Fix a few bugs in MergeArmature's locked mode
This commit is contained in:
parent
e82892847a
commit
033b316fde
@ -35,8 +35,8 @@ namespace net.fushizen.modular_avatar.core
|
|||||||
[DisallowMultipleComponent]
|
[DisallowMultipleComponent]
|
||||||
public class ModularAvatarMergeArmature : AvatarTagComponent
|
public class ModularAvatarMergeArmature : AvatarTagComponent
|
||||||
{
|
{
|
||||||
private const float POS_EPSILON = 0.01f;
|
private const float POS_EPSILON = 0.001f * 0.001f;
|
||||||
private const float ROT_EPSILON = 0.01f;
|
private const float ROT_EPSILON = 0.001f * 0.001f;
|
||||||
|
|
||||||
public AvatarObjectReference mergeTarget;
|
public AvatarObjectReference mergeTarget;
|
||||||
public GameObject mergeTargetObject => mergeTarget.Get(this);
|
public GameObject mergeTargetObject => mergeTarget.Get(this);
|
||||||
@ -86,7 +86,7 @@ namespace net.fushizen.modular_avatar.core
|
|||||||
|
|
||||||
void EditorUpdate()
|
void EditorUpdate()
|
||||||
{
|
{
|
||||||
if (this == null || lockedBones == null)
|
if (this == null)
|
||||||
{
|
{
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
EditorApplication.update -= EditorUpdate;
|
EditorApplication.update -= EditorUpdate;
|
||||||
@ -94,6 +94,11 @@ namespace net.fushizen.modular_avatar.core
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!locked || lockedBones == null)
|
||||||
|
{
|
||||||
|
CheckLock();
|
||||||
|
}
|
||||||
|
|
||||||
if (lockedBones != null)
|
if (lockedBones != null)
|
||||||
{
|
{
|
||||||
foreach (var bone in lockedBones)
|
foreach (var bone in lockedBones)
|
||||||
@ -158,6 +163,8 @@ namespace net.fushizen.modular_avatar.core
|
|||||||
{
|
{
|
||||||
Transform baseObject = FindCorresponding(xform);
|
Transform baseObject = FindCorresponding(xform);
|
||||||
|
|
||||||
|
if (baseObject == null) continue;
|
||||||
|
|
||||||
lockedBones.Add(new BoneBinding()
|
lockedBones.Add(new BoneBinding()
|
||||||
{
|
{
|
||||||
baseBone = baseObject,
|
baseBone = baseObject,
|
||||||
@ -171,7 +178,7 @@ namespace net.fushizen.modular_avatar.core
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
if (locked)
|
if (shouldLock)
|
||||||
{
|
{
|
||||||
EditorApplication.update += EditorUpdate;
|
EditorApplication.update += EditorUpdate;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user