mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-08-28 05:44:48 -05:00
fix factor. add cloth to hips
This commit is contained in:
@@ -21,6 +21,7 @@ namespace UniVRM10.Cloth.Viewer
|
||||
|
||||
[Header("Cloth")]
|
||||
[SerializeField] Toggle m_useJob = default;
|
||||
[SerializeField] Toggle m_addClothToHips = default;
|
||||
[SerializeField] Button m_reconstructSprngBone = default;
|
||||
[SerializeField] Button m_resetSpringBone = default;
|
||||
[SerializeField] Toggle m_pauseSpringBone = default;
|
||||
@@ -61,6 +62,7 @@ namespace UniVRM10.Cloth.Viewer
|
||||
m_showBoxMan = map.Get<Toggle>("ShowBoxMan");
|
||||
|
||||
m_useJob = map.Get<Toggle>("UseJob");
|
||||
m_addClothToHips = map.Get<Toggle>("AddClothToHips");
|
||||
m_reconstructSprngBone = map.Get<Button>("ReconstcutSpringBone");
|
||||
m_resetSpringBone = map.Get<Button>("ResetSpringBone");
|
||||
m_pauseSpringBone = map.Get<Toggle>("PauseSpringBone");
|
||||
@@ -405,14 +407,17 @@ namespace UniVRM10.Cloth.Viewer
|
||||
go => go.AddComponent<ClothWarpRoot>());
|
||||
}
|
||||
|
||||
if (animator.GetBoneTransform(HumanBodyBones.Hips) is var hips)
|
||||
if (m_addClothToHips.isOn)
|
||||
{
|
||||
var cloth = hips.GetComponent<ClothGrid>();
|
||||
if (cloth == null)
|
||||
if (animator.GetBoneTransform(HumanBodyBones.Hips) is var hips)
|
||||
{
|
||||
cloth = hips.gameObject.AddComponent<ClothGrid>();
|
||||
cloth.Reset();
|
||||
cloth.LoopIsClosed = true;
|
||||
var cloth = hips.GetComponent<ClothGrid>();
|
||||
if (cloth == null)
|
||||
{
|
||||
cloth = hips.gameObject.AddComponent<ClothGrid>();
|
||||
cloth.Reset();
|
||||
cloth.LoopIsClosed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user