mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-04-25 15:47:26 -05:00
[vrm-1.0][editor][play] call SpringBone.ReconstructSpringBone when changed
#2410
This commit is contained in:
parent
1e1f38c2fe
commit
40c4777361
|
|
@ -6,6 +6,18 @@ namespace UniVRM10
|
|||
[CustomEditor(typeof(VRM10SpringBoneCollider))]
|
||||
class VRM10SpringBoneColliderEditor : Editor
|
||||
{
|
||||
VRM10SpringBoneCollider _target;
|
||||
Vrm10Instance _vrm;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
_target = (VRM10SpringBoneCollider)target;
|
||||
if(_target!=null)
|
||||
{
|
||||
_vrm = _target.GetComponentInParent<Vrm10Instance>();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
if (VRM10Window.Active == target)
|
||||
|
|
@ -41,7 +53,18 @@ namespace UniVRM10
|
|||
DrawPropertiesExcluding(serializedObject, nameof(component.Normal), "m_Script");
|
||||
break;
|
||||
}
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
if (serializedObject.ApplyModifiedProperties())
|
||||
{
|
||||
if (Application.isPlaying)
|
||||
{
|
||||
// UniGLTF.UniGLTFLogger.Log("invaliate");
|
||||
if(_vrm!=null)
|
||||
{
|
||||
_vrm.Runtime.SpringBone.ReconstructSpringBone();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -70,7 +70,17 @@ namespace UniVRM10
|
|||
LimitBreakSlider(m_jointRadiusProp, 0.0f, 0.5f, 0.0f, Mathf.Infinity);
|
||||
}
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
if (serializedObject.ApplyModifiedProperties())
|
||||
{
|
||||
if (Application.isPlaying)
|
||||
{
|
||||
// UniGLTF.UniGLTFLogger.Log("invaliate");
|
||||
if(m_root!=null)
|
||||
{
|
||||
m_root.Runtime.SpringBone.ReconstructSpringBone();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user